Template:Example: Difference between revisions
Content added Content deleted
(Add template to set up an example page) |
|||
(7 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
⚫ | |||
__NOTOC__ |
|||
{{#set:example of={{{task}}}}} |
|||
{{#set:implemented in language={{#if: {{{langpage|}}} | {{{langpage}}} |{{{language}}}}}}} |
|||
⚫ | |||
Sets up an example page |
Sets up an example page |
||
{| |
{| |
||
Line 17: | Line 14: | ||
|(optional) The pagename of the language, if different (for example: C_sharp for C#) |
|(optional) The pagename of the language, if different (for example: C_sharp for C#) |
||
|} |
|} |
||
For example, when adding an example of the [[Hough transform]] implemented in C++, you would put this at the top of your example page: |
|||
<nowiki>=={{example|task=Hough transform|language=C++}}==</nowiki> |
|||
If you are adding an example in a language that needs a special page title, such as C#, you would put this at the top of your example page: |
|||
<nowiki>=={{example|task=Hough transform|language=C#|langpage=C_sharp}}==</nowiki> |
|||
Unfortunately, the header markup needs to be in the page that uses the template, rather than the template itself. Otherwise, you won't see edit links. |
|||
{{template}}</noinclude> |
{{template}}</noinclude> |
Latest revision as of 21:42, 2 February 2012
[[:Category:{{{language}}}|{{{language}}}]]
Sets up an example page
param name | meaning |
---|---|
task | The name of the task this is an example of |
language | The name of the language this example is implemented in |
langpage | (optional) The pagename of the language, if different (for example: C_sharp for C#) |
For example, when adding an example of the Hough transform implemented in C++, you would put this at the top of your example page: =={{example|task=Hough transform|language=C++}}==
If you are adding an example in a language that needs a special page title, such as C#, you would put this at the top of your example page: =={{example|task=Hough transform|language=C#|langpage=C_sharp}}==
Unfortunately, the header markup needs to be in the page that uses the template, rather than the template itself. Otherwise, you won't see edit links.