Template:Example: Difference between revisions
(remove newlines) |
(Add a couple of usage examples for this template. Also, hopefully fix whatever is breaking additional headers.) |
||
Line 1: | Line 1: | ||
{{#set:example of={{{task}}}}}{{#set:implemented in language={{#if: |
{{#set:example of={{{task}}}}}{{#set:implemented in language={{#if:{{{langpage|}}}|{{{langpage}}}|{{{language}}}}}}}{{#if: {{{langpage|}}} | <span id="{{{language}}}">[[:Category:{{{language}}}|{{{langpage}}}]]</span> | [[:Category:{{{language}}}|{{{language}}}]] }}<noinclude><br/> |
||
Sets up an example page |
Sets up an example page |
||
{| |
{| |
||
Line 14: | 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> |
|||
{{template}}</noinclude> |
{{template}}</noinclude> |
Revision as of 21:43, 19 August 2010
Property "Example of" (as page type) with input value "{{{task}}}" contains invalid characters or is incomplete and therefore can cause unexpected results during a query or annotation process.Property "Implemented in language" (as page type) with input value "{{{language}}}" contains invalid characters or is incomplete and therefore can cause unexpected results during a query or annotation process.[[: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}}==