Template:Nasal doc: Difference between revisions
Jump to navigation
Jump to search
Red Leader (talk | contribs) (Add example) |
Red Leader (talk | contribs) m (Red Leader moved page User:Red Leader/Sandbox/Template:Nasal doc to Template:Nasal doc: Finished development - ready for use) |
(No difference)
|
Revision as of 16:52, 20 November 2014
The following template description is not displayed when the template is inserted in an article.
Goal
This template is to be used to document Nasal API functions. The under-lying aim is to unify Nasal documentation on the wiki.
Usage
{{User:Red_Leader/Sandbox/Template:Nasal_doc | name = | syntax = | text = | param1 ... 10 = | param1text ... param10text = | example1 ... example10 = }}
All parameters are optional.
Basic data
- name
- Name of function (i.e., maketimer).
- syntax
- Syntax of function. Caution Use <syntaxhighlight lang="nasal"/>
- text
- Description text
- param1
- Parameter name for function. Ranges from param1 ... param10
- param1text
- Description of parameter. Ranges from param1text ... param10text
- example1
- Example of function. Ranges from example1 ... example10. Caution Use <syntaxhighlight lang="nasal"/>
Example
{{User:Red_Leader/Sandbox/Template:Nasal_doc |name = function |syntax = <syntaxhighlight lang="nasal">function(a, [b, c]);</syntaxhighlight> |text = Returns a value or '''nil'''. |param1 = a |param1text = Mandatory argument. |param2 = b |param2text = Optional argument. |param3 = c |param3text = Optional argument. |example1 = <syntaxhighlight lang="nasal">var variable = function("string");</syntaxhighlight> <syntaxhighlight lang="nasal">var variable = function("string", 1.234, FlightGear);</syntaxhighlight> }}
User:Red Leader/Sandbox/Template:Nasal doc
Known issues
You have to manually input <syntaxhighlight lang="nasal"/>.