Template:Nasal doc: Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
m (Red Leader moved page User:Red Leader/Sandbox/Template:Nasal doc to Template:Nasal doc: Finished development - ready for use)
m (Template name)
Line 20: Line 20:


== Usage ==
== Usage ==
  <nowiki>{{</nowiki>'''User:Red_Leader/Sandbox/Template:Nasal_doc'''
  <nowiki>{{</nowiki>'''Nasal doc'''
  <nowiki>|</nowiki> ''name''                      =  
  <nowiki>|</nowiki> ''name''                      =  
  <nowiki>|</nowiki> ''syntax''                    =  
  <nowiki>|</nowiki> ''syntax''                    =  
Line 45: Line 45:


== Example ==
== Example ==
  <nowiki>{{</nowiki>'''User:Red_Leader/Sandbox/Template:Nasal_doc'''
  <nowiki>{{</nowiki>'''Nasal doc'''
  <nowiki>|</nowiki>name = function
  <nowiki>|</nowiki>name = function
  <nowiki>|syntax = <syntaxhighlight lang="nasal">function(a, [b, c]);</syntaxhighlight></nowiki>
  <nowiki>|syntax = <syntaxhighlight lang="nasal">function(a, [b, c]);</syntaxhighlight></nowiki>
Line 59: Line 59:
  <nowiki>}}</nowiki>
  <nowiki>}}</nowiki>


{{User:Red_Leader/Sandbox/Template:Nasal_doc
{{Nasal doc
|name = function
|name = function
|syntax = <syntaxhighlight lang="nasal">function(a, [b, c]);</syntaxhighlight>
|syntax = <syntaxhighlight lang="nasal">function(a, [b, c]);</syntaxhighlight>

Revision as of 16:55, 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

{{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"/>.