Template:Nasal doc: Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
mNo edit summary
(Add doc)
Line 14: Line 14:
'''Example(s)'''
'''Example(s)'''
{{{example1|}}}{{{example2|}}}{{{example3|}}}{{{example4|}}}{{{example5|}}}{{{example6|}}}{{{example7|}}}{{{example8|}}}{{{example9|}}}{{{example10|}}}</includeonly><noinclude>
{{{example1|}}}{{{example2|}}}{{{example3|}}}{{{example4|}}}{{{example5|}}}{{{example6|}}}{{{example7|}}}{{{example8|}}}{{{example9|}}}{{{example10|}}}</includeonly><noinclude>
{{User:Red_Leader/Sandbox/Template:Nasal_doc
{{Informative template|1=
|name = function
__NOTOC__
|syntax = <syntaxhighlight lang="nasal">function(a, [b, c]);</syntaxhighlight>
== Goal ==
|text = May returns values, or just '''nil''' (implicitly for procedures and empty return expressions).
This template is to be used to document [[Nasal]] API functions.  The under-lying aim is to unify Nasal documentation on the wiki.
|param1 = a
 
|param1text = Argument
== Usage ==
|param2 = b
<nowiki>{{</nowiki>'''User:Red_Leader/Sandbox/Template:Nasal_doc'''
|param2text = Optional argument
<nowiki>|</nowiki> ''name''                      =  
|param3 = c
<nowiki>|</nowiki> ''syntax''                    =  
|param3text = Optional argument
<nowiki>|</nowiki> ''text''                       =
|example1 = <syntaxhighlight lang="nasal">var variable = function("string", 10, foo);</syntaxhighlight>
<nowiki>|</nowiki> ''param1 ... 10''             =  
<syntaxhighlight lang="nasal">var variable = function("string");</syntaxhighlight>
<nowiki>|</nowiki> ''param1text ... param10text'' =  
<nowiki>|</nowiki> ''example1 ... example10''    =  
<nowiki>}}</nowiki>
 
All parameters are optional.
 
=== Basic data ===
; name:  Name of function (i.e., <tt>maketimer</tt>).
 
; syntax:  Syntax of function. {{icaution|Use <nowiki><syntaxhighlight lang="nasal"/></nowiki>}}
 
; text:  Description text
 
; param1:  Parameter name for function. Ranges from <tt>param1 ... param10</tt>
 
; param1text:  Description of parameter. Ranges from <tt>param1text ... param10text</tt>
 
; example1:  Example of function. Ranges from <tt>example1 ... example10</tt>. {{icaution|Use <nowiki><syntaxhighlight lang="nasal"/></nowiki>}}
 
== Known issues ==
You have to manually input <tt><nowiki><syntaxhighlight lang="nasal"/></nowiki></tt>.
 
}}
}}
[[Category:Templates]]
</noinclude>
</noinclude>

Revision as of 16:39, 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"/>

Known issues

You have to manually input <syntaxhighlight lang="nasal"/>.