Updated tomdoc.sh to treat all functions as code

This commit is contained in:
Tyler Akins 2015-10-07 15:58:45 -05:00
parent d8141aabaa
commit d3c8fb0671

104
API.md
View File

@ -4,8 +4,8 @@ API / Function Documentation
This documentation is generated automatically from the source of [mo] thanks to [tomdoc.sh]. This documentation is generated automatically from the source of [mo] thanks to [tomdoc.sh].
mo() `mo()`
---- ------
Public: Template parser function. Writes templates to stdout. Public: Template parser function. Writes templates to stdout.
@ -15,8 +15,8 @@ Public: Template parser function. Writes templates to stdout.
Returns nothing. Returns nothing.
moFindEndTag() `moFindEndTag()`
-------------- ----------------
Internal: Scan content until the right end tag is found. Creates an array with the following members: Internal: Scan content until the right end tag is found. Creates an array with the following members:
@ -34,8 +34,8 @@ Everything using this function uses the "standalone tags" logic.
Returns nothing. Returns nothing.
moFindString() `moFindString()`
-------------- ----------------
Internal: Find the first index of a substring. If not found, sets the index to -1. Internal: Find the first index of a substring. If not found, sets the index to -1.
@ -46,8 +46,8 @@ Internal: Find the first index of a substring. If not found, sets the index to
Returns nothing. Returns nothing.
moFullTagName() `moFullTagName()`
--------------- -----------------
Internal: Generate a dotted name based on current context and target name. Internal: Generate a dotted name based on current context and target name.
@ -58,19 +58,19 @@ Internal: Generate a dotted name based on current context and target name.
Returns nothing. Returns nothing.
moGetContent() `moGetContent()`
-------------- ----------------
Internal: Fetches the content to parse into a variable. Can be a list of partials for files or the content from stdin. Internal: Fetches the content to parse into a variable. Can be a list of partials for files or the content from stdin.
* $1 - Variable name to assign this content back as * $1 - Variable name to assign this content back as
* $2-* - File names (optional) * $2-@ - File names (optional)
Returns nothing. Returns nothing.
moIndentLines() `moIndentLines()`
--------------- -----------------
Internal: Indent a string, placing the indent at the beginning of every line that has any content. Internal: Indent a string, placing the indent at the beginning of every line that has any content.
@ -81,8 +81,8 @@ Internal: Indent a string, placing the indent at the beginning of every line tha
Returns nothing. Returns nothing.
moIndirect() `moIndirect()`
------------ --------------
Internal: Send a variable up to the parent of the caller of this function. Internal: Send a variable up to the parent of the caller of this function.
@ -100,13 +100,13 @@ Examples
Returns nothing. Returns nothing.
moIndirectArray() `moIndirectArray()`
----------------- -------------------
Internal: Send an array as a variable up to caller of a function Internal: Send an array as a variable up to caller of a function
* $1 - Variable name * $1 - Variable name
* $2-* - Array elements * $2-@ - Array elements
Examples Examples
@ -120,8 +120,8 @@ Examples
Returns nothing. Returns nothing.
moIsArray() `moIsArray()`
----------- -------------
Internal: Determine if a given environment variable exists and if it is an array. Internal: Determine if a given environment variable exists and if it is an array.
@ -138,8 +138,8 @@ Examples
Returns 0 if the name is not empty, 1 otherwise. Returns 0 if the name is not empty, 1 otherwise.
moIsFunction() `moIsFunction()`
-------------- ----------------
Internal: Determine if the given name is a defined function. Internal: Determine if the given name is a defined function.
@ -157,8 +157,8 @@ Examples
Returns 0 if the name is a function, 1 otherwise. Returns 0 if the name is a function, 1 otherwise.
moIsStandalone() `moIsStandalone()`
---------------- ------------------
Internal: Determine if the tag is a standalone tag based on whitespace before and after the tag. Internal: Determine if the tag is a standalone tag based on whitespace before and after the tag.
@ -178,8 +178,8 @@ Examples
Returns nothing. Returns nothing.
moJoin() `moJoin()`
-------- ----------
Internal: Join / implode an array Internal: Join / implode an array
@ -190,8 +190,8 @@ Internal: Join / implode an array
Returns nothing. Returns nothing.
moLoadFile() `moLoadFile()`
------------ --------------
Internal: Read a file into a variable. Internal: Read a file into a variable.
@ -201,20 +201,20 @@ Internal: Read a file into a variable.
Returns nothing. Returns nothing.
moLoop() `moLoop()`
-------- ----------
Internal: Process a chunk of content some number of times. Writes output to stdout. Internal: Process a chunk of content some number of times. Writes output to stdout.
* $1 - Content to parse repeatedly * $1 - Content to parse repeatedly
* $2 - Tag prefix (context name) * $2 - Tag prefix (context name)
* $3-* - Names to insert into the parsed content * $3-@ - Names to insert into the parsed content
Returns nothing. Returns nothing.
moParse() `moParse()`
--------- -----------
Internal: Parse a block of text, writing the result to stdout. Internal: Parse a block of text, writing the result to stdout.
@ -225,8 +225,8 @@ Internal: Parse a block of text, writing the result to stdout.
Returns nothing. Returns nothing.
moPartial() `moPartial()`
----------- -------------
Internal: Process a partial. Internal: Process a partial.
@ -244,8 +244,8 @@ Prefix all variables.
Returns nothing. Returns nothing.
moShow() `moShow()`
-------- ----------
Internal: Show an environment variable or the output of a function to stdout. Internal: Show an environment variable or the output of a function to stdout.
@ -257,8 +257,8 @@ Limit/prefix any variables used.
Returns nothing. Returns nothing.
moSplit() `moSplit()`
--------- -----------
Internal: Split a larger string into an array. Internal: Split a larger string into an array.
@ -270,8 +270,8 @@ Internal: Split a larger string into an array.
Returns nothing. Returns nothing.
moStandaloneAllowed() `moStandaloneAllowed()`
--------------------- -----------------------
Internal: Handle the content for a standalone tag. This means removing whitespace (not newlines) before a tag and whitespace and a newline after a tag. That is, assuming, that the line is otherwise empty. Internal: Handle the content for a standalone tag. This means removing whitespace (not newlines) before a tag and whitespace and a newline after a tag. That is, assuming, that the line is otherwise empty.
@ -284,8 +284,8 @@ Internal: Handle the content for a standalone tag. This means removing whitespa
Returns nothing. Returns nothing.
moStandaloneDenied() `moStandaloneDenied()`
-------------------- ----------------------
Internal: Handle the content for a tag that is never "standalone". No adjustments are made for newlines and whitespace. Internal: Handle the content for a tag that is never "standalone". No adjustments are made for newlines and whitespace.
@ -297,8 +297,8 @@ Internal: Handle the content for a tag that is never "standalone". No adjustmen
Returns nothing. Returns nothing.
moTest() `moTest()`
-------- ----------
Internal: Determines if the named thing is a function or if it is a non-empty environment variable. Internal: Determines if the named thing is a function or if it is a non-empty environment variable.
@ -310,8 +310,8 @@ Do not use variables without prefixes here if possible as this needs to check if
Returns 0 if the name is not empty, 1 otherwise. Returns 0 if the name is not empty, 1 otherwise.
moTrimChars() `moTrimChars()`
------------- ---------------
Internal: Trim the leading whitespace only. Internal: Trim the leading whitespace only.
@ -319,13 +319,13 @@ Internal: Trim the leading whitespace only.
* $2 - The string * $2 - The string
* $3 - true/false - trim front? * $3 - true/false - trim front?
* $4 - true/false - trim end? * $4 - true/false - trim end?
* $5-* - Characters to trim * $5-@ - Characters to trim
Returns nothing. Returns nothing.
moTrimWhitespace() `moTrimWhitespace()`
------------------ --------------------
Internal: Trim leading and trailing whitespace from a string. Internal: Trim leading and trailing whitespace from a string.
@ -335,8 +335,8 @@ Internal: Trim leading and trailing whitespace from a string.
Returns nothing. Returns nothing.
moUsage() `moUsage()`
--------- -----------
Internal: Displays the usage for mo. Pulls this from the file that contained the `mo` function. Can only work when the right filename comes is the one argument, and that only happens when `mo` is called with `$0` set to this file. Internal: Displays the usage for mo. Pulls this from the file that contained the `mo` function. Can only work when the right filename comes is the one argument, and that only happens when `mo` is called with `$0` set to this file.