Template:Nasal doc
Jump to navigation
Jump to search
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
{{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
{{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> }}
function
function(a, [b, c]);
Returns a value or nil.
- a
- Mandatory argument.
- b
- Optional argument.
- c
- Optional argument.
Example(s)
var variable = function("string");
var variable = function("string", 1.234, FlightGear);
Known issues
You have to manually input <syntaxhighlight lang="nasal"/>.