Template:Func link: Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
(Update to <code> tags)
(Add <span class="plainlinks"> + api -> 1. Could do this differently)
Line 1: Line 1:
<includeonly>{{#if: {{{ext|}}} <!-- is an external link is supplied?
<includeonly>{{#if: {{{ext|}}} <!-- is an external link is supplied?
-->| <span class="plainlinks">[{{{ext}}} <code>{{{api}}}</code>]</span> <!-- yes, so link to that
-->| <span class="plainlinks">[{{{ext}}} <code>{{{1}}}</code>]</span> <!-- yes, so link to that


-->| {{#switch: {{{api|error}}} <!-- no, so use switch for pre-set APIs
-->| {{#switch: {{{1|error}}} <!-- no, so use switch for pre-set APIs
-->| error = <big style="color:red">Missing argument!</big> <!-- error message -->
-->| error = <big style="color:red">Missing argument!</big> <!-- error message -->
<!-- pre-made links for core library Nasal APIs below -->
<!-- pre-made links for core library Nasal APIs below -->
| append
| append
| append() = [[User:Red_Leader/Nasal_library#append.28.29|<tcodet>append()</code>]]
| append() = <span class="plainlinks">[[User:Red_Leader/Nasal_library#append.28.29|<code>append()</code>]]</span>
| bind
| bind
| bind() = [[User:Red_Leader/Nasal_library#bind.28.29|<code>bind()</code>]]
| bind() = <span class="plainlinks">[[User:Red_Leader/Nasal_library#bind.28.29|<code>bind()</code>]]</span>
| call
| call
| call() = [[User:Red_Leader/Nasal_library#call.28.29|<code>call()</code>]]
| call() = <span class="plainlinks">[[User:Red_Leader/Nasal_library#call.28.29|<code>call()</code>]]</span>
| caller
| caller
| caller() = [[User:Red_Leader/Nasal_library#caller.28.29|<code>caller()</code>]]
| caller() = <span class="plainlinks">[[User:Red_Leader/Nasal_library#caller.28.29|<code>caller()</code>]]</span>
| chr
| chr
| chr() = [[User:Red_Leader/Nasal_library#chr.28.29|<code>chr()</code>]]
| chr() = <span class="plainlinks">[[User:Red_Leader/Nasal_library#chr.28.29|<code>chr()</code>]]</span>
| closure
| closure
| closure() = [[User:Red_Leader/Nasal_library#closure.28.29|<code>closure()</code>]]
| closure() = <span class="plainlinks">[[User:Red_Leader/Nasal_library#closure.28.29|<code>closure()</code>]]</span>
| cmp
| cmp
| cmp() = [[User:Red_Leader/Nasal_library#cmp.28.29|<code>cmp()</code>]]
| cmp() = <span class="plainlinks">[[User:Red_Leader/Nasal_library#cmp.28.29|<code>cmp()</code>]]</span>
| compile
| compile
| compile() = [[User:Red_Leader/Nasal_library#compile.28.29|<code>compile()</code>]]
| compile() = <span class="plainlinks">[[User:Red_Leader/Nasal_library#compile.28.29|<code>compile()</code>]]</span>
| contains
| contains
| contains() = [[User:Red_Leader/Nasal_library#contains.28.29|<code>contains()</code>]]
| contains() = <span class="plainlinks">[[User:Red_Leader/Nasal_library#contains.28.29|<code>contains()</code>]]</span>
| delete
| delete
| delete() = [[User:Red_Leader/Nasal_library#delete.28.29|<code>delete()</code>]]
| delete() = <span class="plainlinks">[[User:Red_Leader/Nasal_library#delete.28.29|<code>delete()</code>]]</span>
| die
| die
| die() = [[User:Red_Leader/Nasal_library#die.28.29|<code>die()</code>]]
| die() = <span class="plainlinks">[[User:Red_Leader/Nasal_library#die.28.29|<code>die()</code>]]</span>
| find
| find
| find() = [[User:Red_Leader/Nasal_library#find.28.29|<code>find()</code>]]
| find() = <span class="plainlinks">[[User:Red_Leader/Nasal_library#find.28.29|<code>find()</code>]]</span>
| ghosttype
| ghosttype
| ghosttype() = [[User:Red_Leader/Nasal_library#ghosttype.28.29|<code>ghosttype()</code>]]
| ghosttype() = <span class="plainlinks">[[User:Red_Leader/Nasal_library#ghosttype.28.29|<code>ghosttype()</code>]]</span>
| id
| id
| id() = [[User:Red_Leader/Nasal_library#id.28.29|<code>id()</code>]]
| id() = <span class="plainlinks">[[User:Red_Leader/Nasal_library#id.28.29|<code>id()</code>]]</span>
| int
| int
| int() = [[User:Red_Leader/Nasal_library#int.28.29|<code>int()</code>]]
| int() = <span class="plainlinks">[[User:Red_Leader/Nasal_library#int.28.29|<code>int()</code>]]</span>
| keys
| keys
| keys() = [[User:Red_Leader/Nasal_library#keys.28.29|<code>keys()</code>]]
| keys() = <span class="plainlinks">[[User:Red_Leader/Nasal_library#keys.28.29|<code>keys()</code>]]</span>
| left
| left
| left() = [[User:Red_Leader/Nasal_library#left.28.29|<code>left()</code>]]
| left() = <span class="plainlinks">[[User:Red_Leader/Nasal_library#left.28.29|<code>left()</code>]]</span>
| num
| num
| num() = [[User:Red_Leader/Nasal_library#num.28.29|<code>num()</code>]]
| num() = <span class="plainlinks">[[User:Red_Leader/Nasal_library#num.28.29|<code>num()</code>]]</span>
| pop
| pop
| pop() = [[User:Red_Leader/Nasal_library#pop.28.29|<code>pop()</code>]]
| pop() = <span class="plainlinks">[[User:Red_Leader/Nasal_library#pop.28.29|<code>pop()</code>]]</span>
| right
| right
| right() = [[User:Red_Leader/Nasal_library#right.28.29|<code>right()</code>]]
| right() = <span class="plainlinks">[[User:Red_Leader/Nasal_library#right.28.29|<code>right()</code>]]</span>
| setsize
| setsize
| setsize() = [[User:Red_Leader/Nasal_library#setsize.28.29|<code>setsize()</code>]]
| setsize() = <span class="plainlinks">[[User:Red_Leader/Nasal_library#setsize.28.29|<code>setsize()</code>]]</span>
| size
| size
| size() = [[User:Red_Leader/Nasal_library#size.28.29|<code>size()</code>]]
| size() = <span class="plainlinks">[[User:Red_Leader/Nasal_library#size.28.29|<code>size()</code>]]</span>
| sort
| sort
| sort() = [[User:Red_Leader/Nasal_library#sort.28.29|<code>sort()</code>]]
| sort() = <span class="plainlinks">[[User:Red_Leader/Nasal_library#sort.28.29|<code>sort()</code>]]</span>
| split
| split
| split() = [[User:Red_Leader/Nasal_library#split.28.29|<code>split()</code>]]
| split() = <span class="plainlinks">[[User:Red_Leader/Nasal_library#split.28.29|<code>split()</code>]]</span>
| sprintf
| sprintf
| sprintf() = [[User:Red_Leader/Nasal_library#sprintf.28.29|<code>sprintf()</code>]]
| sprintf() = <span class="plainlinks">[[User:Red_Leader/Nasal_library#sprintf.28.29|<code>sprintf()</code>]]</span>
| streq
| streq
| streq() = [[User:Red_Leader/Nasal_library#streq.28.29|<code>streq()</code>]]
| streq() = <span class="plainlinks">[[User:Red_Leader/Nasal_library#streq.28.29|<code>streq()</code>]]</span>
| substr
| substr
| substr() = [[User:Red_Leader/Nasal_library#substr.28.29|<code>substr()</code>]]
| substr() = <span class="plainlinks">[[User:Red_Leader/Nasal_library#substr.28.29|<code>substr()</code>]]</span>
| subvec
| subvec
| subvec() = [[User:Red_Leader/Nasal_library#subvec.28.29|<code>subvec()</code>]]
| subvec() = <span class="plainlinks">[[User:Red_Leader/Nasal_library#subvec.28.29|<code>subvec()</code>]]</span>
| typeof
| typeof
| typeof() = [[User:Red_Leader/Nasal_library#typeof.28.29|<code>typeof()</code>]]
| typeof() = <span class="plainlinks">[[User:Red_Leader/Nasal_library#typeof.28.29|<code>typeof()</code>]]</span>
<!-- extension functions -->
<!-- extension functions -->
| cmdarg
| cmdarg
| cmdarg() = [[List_of_Nasal_extension_functions#cmdarg.28.29|<code>cmdarg()</code>]]
| cmdarg() = <span class="plainlinks">[[List_of_Nasal_extension_functions#cmdarg.28.29|<code>cmdarg()</code>]]</span>
| fgcommand
| fgcommand
| fgcommand() = [[List_of_Nasal_extension_functions#fgcommand.28.29|<code>fgcommand()</code>]]
| fgcommand() = <span class="plainlinks">[[List_of_Nasal_extension_functions#fgcommand.28.29|<code>fgcommand()</code>]]</span>
| addcommand
| addcommand
| addcommand() = [[List_of_Nasal_extension_functions#addcommand.28.29|<code>addcommand()</code>]]
| addcommand() = <span class="plainlinks">[[List_of_Nasal_extension_functions#addcommand.28.29|<code>addcommand()</code>]]</span>
| removecommand
| removecommand
| removecommand() = [[List_of_Nasal_extension_functions#removecommand.28.29|<code>removecommand()</code>]]
| removecommand() = <span class="plainlinks">[[List_of_Nasal_extension_functions#removecommand.28.29|<code>removecommand()</code>]]</span>
| print
| print
| print() = [[List_of_Nasal_extension_functions#print.28.29|<code>print()</code>]]
| print() = <span class="plainlinks">[[List_of_Nasal_extension_functions#print.28.29|<code>print()</code>]]</span>
| logprint
| logprint
| logprint() = [[List_of_Nasal_extension_functions#logprint.28.29|<code>logprint()</code>]]
| logprint() = <span class="plainlinks">[[List_of_Nasal_extension_functions#logprint.28.29|<code>logprint()</code>]]</span>
| getprop
| getprop
| getprop() = [[List_of_Nasal_extension_functions#getprop.28.29|<code>getprop()</code>]]
| getprop() = <span class="plainlinks">[[List_of_Nasal_extension_functions#getprop.28.29|<code>getprop()</code>]]</span>
| setprop
| setprop
| setprop() = [[List_of_Nasal_extension_functions#setprop.28.29|<code>setprop()</code>]]
| setprop() = <span class="plainlinks">[[List_of_Nasal_extension_functions#setprop.28.29|<code>setprop()</code>]]</span>
| interpolate
| interpolate
| interpolate() = [[List_of_Nasal_extension_functions#interpolate.28.29|<code>interpolate()</code>]]
| interpolate() = <span class="plainlinks">[[List_of_Nasal_extension_functions#interpolate.28.29|<code>interpolate()</code>]]</span>
| settimer
| settimer
| settimer() = [[List_of_Nasal_extension_functions#settimer.28.29|<code>settimer()</code>]]
| settimer() = <span class="plainlinks">[[List_of_Nasal_extension_functions#settimer.28.29|<code>settimer()</code>]]</span>
| maketimer
| maketimer
| maketimer() = [[List_of_Nasal_extension_functions#maketimer.28.29_.282.11.2B.29|<code>maketimer()</code>]]
| maketimer() = <span class="plainlinks">[[List_of_Nasal_extension_functions#maketimer.28.29_.282.11.2B.29|<code>maketimer()</code>]]</span>
| geodinfo
| geodinfo
| geodinfo() = [[List_of_Nasal_extension_functions#geodinfo.28.29|<code>geodinfo()</code>]]
| geodinfo() = <span class="plainlinks">[[List_of_Nasal_extension_functions#geodinfo.28.29|<code>geodinfo()</code>]]</span>
| airportinfo
| airportinfo
| airportinfo() = [[List_of_Nasal_extension_functions#airportinfo.28.29|<code>airportinfo()</code>]]
| airportinfo() = <span class="plainlinks">[[List_of_Nasal_extension_functions#airportinfo.28.29|<code>airportinfo()</code>]]</span>
| history
| history
| history() = [[List_of_Nasal_extension_functions#history.28.29_.283.1.2B.29|<code>history()</code>]]
| history() = <span class="plainlinks">[[List_of_Nasal_extension_functions#history.28.29_.283.1.2B.29|<code>history()</code>]]</span>
| flightplan
| flightplan
| flightplan() = [[List_of_Nasal_extension_functions#flightplan.28.29|<code>flightplan()</code>]]
| flightplan() = <span class="plainlinks">[[List_of_Nasal_extension_functions#flightplan.28.29|<code>flightplan()</code>]]</span>
| carttogeod
| carttogeod
| carttogeod() = [[List_of_Nasal_extension_functions#carttogeod.28.29|<code>carttogeod()</code>]]
| carttogeod() = <span class="plainlinks">[[List_of_Nasal_extension_functions#carttogeod.28.29|<code>carttogeod()</code>]]</span>
| geodtocart
| geodtocart
| geodtocart() = [[List_of_Nasal_extension_functions#geodtocart.28.29|<code>geodtocart()</code>]]
| geodtocart() = <span class="plainlinks">[[List_of_Nasal_extension_functions#geodtocart.28.29|<code>geodtocart()</code>]]</span>
| parsexml
| parsexml
| parsexml() = [[List_of_Nasal_extension_functions#parsexml.28.29|<code>parsexml()</code>]]
| parsexml() = <span class="plainlinks">[[List_of_Nasal_extension_functions#parsexml.28.29|<code>parsexml()</code>]]</span>
| resolvepath
| resolvepath
| resolvepath() = [[List_of_Nasal_extension_functions#resolvepath.28.29|<code>resolvepath()</code>]]
| resolvepath() = <span class="plainlinks">[[List_of_Nasal_extension_functions#resolvepath.28.29|<code>resolvepath()</code>]]</span>
| rand
| rand
| rand() = [[List_of_Nasal_extension_functions#rand.28.29|<code>rand()</code>]]
| rand() = <span class="plainlinks">[[List_of_Nasal_extension_functions#rand.28.29|<code>rand()</code>]]</span>
| srand
| srand
| srand() = [[List_of_Nasal_extension_functions#srand.28.29|<code>srand()</code>]]
| srand() = <span class="plainlinks">[[List_of_Nasal_extension_functions#srand.28.29|<code>srand()</code>]]</span>
| md5
| md5
| md5() = [[List_of_Nasal_extension_functions#md5.28.29_.283.1.2B.29|<code>md5()</code>]]
| md5() = <span class="plainlinks">[[List_of_Nasal_extension_functions#md5.28.29_.283.1.2B.29|<code>md5()</code>]]</span>
| abort
| abort
| abort() = [[List_of_Nasal_extension_functions#abort.28.29|<code>abort()</code>]]
| abort() = <span class="plainlinks">[[List_of_Nasal_extension_functions#abort.28.29|<code>abort()</code>]]</span>
| #default = [[{{#if: {{{page|}}} <!-- is it on a different page?
| #default = <span class="plainlinks">[[{{#if: {{{page|}}} <!-- is it on a different page?
-->| {{{page}}} <!-- yes  
-->| {{{page}}} <!-- yes  
-->| {{FULLPAGENAME}} }} <!-- no, it's on the page that the template is on
-->| {{FULLPAGENAME}} }} <!-- no, it's on the page that the template is on
-->#{{{api}}}|<code>{{{api}}}</code>]]<!--  
-->#{{{1}}}|<code>{{{1}}}</code>]]</span><!--  


-->}}<!-- end #switch:
-->}}<!-- end #switch:
Line 134: Line 134:


== Examples ==
== Examples ==
  <nowiki>{{Func link|api=maketimer}} is available in FG 2.11+</nowiki>
  <nowiki>{{Func link|maketimer}} is available in FG 2.11+</nowiki>


{{Func link|api=maketimer}} is available in FG 2.11+
{{Func link|maketimer}} is available in FG 2.11+


  <nowiki>See also {{Func link|api=http.load()|page=List_of_Nasal_extension_functions}}.</nowiki>
  <nowiki>See also {{Func link|http.load()|page=List_of_Nasal_extension_functions}}.</nowiki>


See also {{Func link|api=http.load()|page=List_of_Nasal_extension_functions}}.
See also {{Func link|http.load()|page=List_of_Nasal_extension_functions}}.


  <nowiki>{{Func link|api=printf()|ext=http://en.wikipedia.org/wiki/Printf_format_string}}</nowiki>
  <nowiki>{{Func link|printf()|ext=http://en.wikipedia.org/wiki/Printf_format_string}}</nowiki>


{{Func link|api=printf()|ext=http://en.wikipedia.org/wiki/Printf_format_string}}
{{Func link|printf()|ext=http://en.wikipedia.org/wiki/Printf_format_string}}


}}
}}

Revision as of 11:28, 9 February 2015

The following template description is not displayed when the template is inserted in an article.

Goal

This template can be used to add a link to the documentation of a Nasal API function. It can also be used for others (for example C++ functions) and can link to external sites.

Usage

{{Func link|api|page|ext}}

All parameters except api are optional

api
Name of the function to link to.
page
Link to another wiki page, for example Help:Template.
ext
External link to another site. Overrides page.

Examples

{{Func link|maketimer}} is available in FG 2.11+

maketimer() is available in FG 2.11+

See also {{Func link|http.load()|page=List_of_Nasal_extension_functions}}.

See also http.load().

{{Func link|printf()|ext=http://en.wikipedia.org/wiki/Printf_format_string}}

printf()