Template:Func link: Difference between revisions
Jump to navigation
Jump to search
Red Leader (talk | contribs) (Remove cprint(). Dunno how it ended up in my list) |
Red Leader (talk | contribs) (Use Template:Error) |
||
Line 5: | Line 5: | ||
-->{{#if: {{{ext|}}} <!-- is an external link is supplied? | -->{{#if: {{{ext|}}} <!-- is an external link is supplied? | ||
-->| [{{{ext}}} {{{1| | -->| [{{{ext}}} {{{1|{{error|Missing argument!|func link}}}}}]<!-- yes, so link to that | ||
-->| {{#switch: {{{1|error}}} <!-- no, so use switch for pre-set APIs | -->| {{#switch: {{{1|error}}} <!-- no, so use switch for pre-set APIs | ||
-->| error = | -->| error = {{error|Missing argument!|func link}} <!-- error message --> | ||
<!-- pre-made links for core library Nasal APIs below --> | <!-- pre-made links for core library Nasal APIs below --> | ||
| append | | append |
Revision as of 19:28, 15 November 2016
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
Pre-made links
This example uses the pre-made links for certain APIs.
Note {{Func link|maketimer()}}
is equivalent.
{{Func link|maketimer}} is available in FG 2.11+
maketimer()
is available in FG 2.11+
Link to another wiki page
See also {{Func link|http.load()|page=Nasal library}}.
See also http.load()
.
Link to external site
{{Func link|printf()|ext=http://en.wikipedia.org/wiki/Printf_format_string}}