Template:Func link: Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
(Add to pre-made links)
(Rearrange)
Line 1: Line 1:
<includeonly>{{#switch: {{{api|error}}}
<includeonly>{{#if: {{{ext|}}} <!-- is an external link is supplied?
| error = <big style="color:red">Missing argument!</big> <!-- error message -->
-->| <span class="plainlinks">[{{{ext}}} <tt>{{{api}}}</tt>]</span> <!-- yes, so link to that
-->| {{#switch: {{{api|error}}} <!-- nope
-->| 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
Line 14: Line 16:
| maketimer
| maketimer
| maketimer() = [[List_of_Nasal_extension_functions#maketimer.28.29_.282.11.2B.29|<tt>maketimer()</tt>]]
| maketimer() = [[List_of_Nasal_extension_functions#maketimer.28.29_.282.11.2B.29|<tt>maketimer()</tt>]]
| #default = {{#if: {{{ext|}}}<!-- check if an external link is supplied
| #default = [[<!--  no so add wikilink
-->| <span class="plainlinks">[{{{ext}}} <tt>{{{api}}}</tt>]</span> <!-- yes, so link to that
-->| [[<!--  no so add wikilink
-->{{#if: {{{page|}}} <!-- is it on a different page?
-->{{#if: {{{page|}}} <!-- is it on a different page?
-->| {{{page}}} <!-- yes -->  
-->| {{{page}}} <!-- yes  
| {{FULLPAGENAME}} }} <!-- no, it's on this page
-->| {{FULLPAGENAME}} }} <!-- no, it's on the page that the template is on
-->#{{{api}}}|<tt>{{{api}}}</tt>]] <!-- finish the link
-->#{{{api}}}|<tt>{{{api}}}</tt>]] <!-- finish the link
-->}}}}</includeonly><noinclude>{{Informative template|1=
-->}}}}</includeonly><noinclude>{{Informative template|1=
Line 27: Line 27:


== Usage ==
== Usage ==
  <nowiki>{{</nowiki>'''Func link'''<nowiki>|</nowiki>'''''api'''''<nowiki>|</nowiki>''page''<nowiki>|</nowiki>''ext''<nowiki>}}</nowiki>
  <nowiki>{{</nowiki>'''Func link'''<nowiki>|</nowiki>''api''<nowiki>|</nowiki>''page''<nowiki>|</nowiki>''ext''<nowiki>}}</nowiki>


{{inote|All parameter except '''api''' are optional.}}
{{inote|All parameter except '''api''' are optional.}}
Line 35: Line 35:
; page : If desired, link to another wiki page (e.g., ''Help:Template'').
; page : If desired, link to another wiki page (e.g., ''Help:Template'').


; ext : External link to another site.
; ext : External link to another site.  Overrides '''page'''.


== Examples ==
== Examples ==

Revision as of 17:38, 28 January 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 (e.g., C++ functions) and can link to external sites.

Usage

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

Note All parameter except api are optional.

api
Name of the function to link to.
page
If desired, link to another wiki page (e.g., Help:Template).
ext
External link to another site. Overrides page.

Examples

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

maketimer() is available in FG 2.11+

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

See also http.load().

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

printf()