Template:Nasal doc: Difference between revisions
Jump to navigation
Jump to search
Red Leader (talk | contribs) (Add doc) |
Red Leader (talk | contribs) (Add example) |
||
Line 43: | Line 43: | ||
; example1: Example of function. Ranges from <tt>example1 ... example10</tt>. {{icaution|Use <nowiki><syntaxhighlight lang="nasal"/></nowiki>}} | ; example1: Example of function. Ranges from <tt>example1 ... example10</tt>. {{icaution|Use <nowiki><syntaxhighlight lang="nasal"/></nowiki>}} | ||
== Example == | |||
<nowiki>{{</nowiki>'''User:Red_Leader/Sandbox/Template:Nasal_doc''' | |||
<nowiki>|</nowiki>name = function | |||
<nowiki>|syntax = <syntaxhighlight lang="nasal">function(a, [b, c]);</syntaxhighlight></nowiki> | |||
<nowiki>|text = Returns a value or '''nil'''.</nowiki> | |||
<nowiki>|</nowiki>param1 = a | |||
<nowiki>|</nowiki>param1text = Mandatory argument. | |||
<nowiki>|</nowiki>param2 = b | |||
<nowiki>|</nowiki>param2text = Optional argument. | |||
<nowiki>|</nowiki>param3 = c | |||
<nowiki>|</nowiki>param3text = Optional argument. | |||
<nowiki>|example1 = <syntaxhighlight lang="nasal">var variable = function("string");</syntaxhighlight> | |||
<syntaxhighlight lang="nasal">var variable = function("string", 1.234, FlightGear);</syntaxhighlight></nowiki> | |||
<nowiki>}}</nowiki> | |||
{{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> | |||
}} | |||
== Known issues == | == Known issues == | ||
Line 48: | Line 77: | ||
}} | }} | ||
[[Category:Templates]] | [[Category:Templates]] | ||
</noinclude> | </noinclude> |
Revision as of 16:51, 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"/>.