Template:Header: Difference between revisions

From Rosetta Code
Content added Content deleted
(Header links go straight to categories.)
(Add initial dart implementation of btc address validation)
 
(24 intermediate revisions by 7 users not shown)
Line 1: Line 1:
<includeonly>{{#switch: {{lc: {{{1|}}} }}
{{#if: {{{2|}}} | [[:Category:{{{1}}}|{{{2}}}]] | [[:Category:{{{1}}}|{{{1}}}]] }}[[Category:{{{1}}}]]<noinclude>
| c sharp
| c# = [[:Category:C sharp|C#]] [[Category:C sharp]] {{#set:Implemented in language=C sharp}}
| f sharp
| f_sharp
| f# = [[:Category:F Sharp|F#]] [[Category:F Sharp]] {{#set:Implemented in language=F Sharp}}
| javascript = [[:Category:JavaScript|JavaScript]] [[Category:JavaScript]] {{#set:Implemented in language=JavaScript}}
| dart = [[:Category:Dart|Dart]] [[Category:Dart]] {{#set:Implemented in language=Dart}}
| tex
| plaintex = [[:Category:PlainTeX|{{PlainTeX}}]] [[Category:PlainTeX]] {{#set:Implemented in language=PlainTeX}}
| latex = [[:Category:LaTeX|{{LaTeX}}]] [[Category:LaTeX]] {{#set:Implemented in language=LaTeX}}
| #default = [[:Category:{{{1}}}|{{{1}}}]] [[Category:{{{1}}}]] {{#set:Implemented in language={{{1}}} }}
}}</includeonly><noinclude>Usage: <code><nowiki>=={{header|language name}}==</nowiki></code>


This is intended to be used for the header of a programming language solution. Used within the header, it adds a category with the same name. It can be invoked two ways:
This template is intended to be used for the header of a programming language solution. The language's category is added to the task page and the Semantic MediaWiki property ''Implemented in language'' is set.


For the following languages, any of the listed spellings is ok:
<code><nowiki>
* '''C#''': ''C#'', ''C sharp'' or ''C Sharp''
=={{header|Your Language Here}}==
* '''F#''': ''F#'', ''F sharp'', ''F Sharp'', ''F_sharp'' or ''F_Sharp''
</nowiki></code>
* '''JavaScript''': ''JavaScript'' or ''Javascript''

* '''Dart''': ''Dart'' or ''Dart''
expands to:
* '''{{PlainTeX}}''': ''PlainTeX'' or ''plaintex'' or ''TeX'' or ''tex''

* '''{{LaTeX}}''': ''LaTeX'' or ''latex''
<code><nowiki>
{{template}}
==[[Your Language Here]] [[Category:Your Language Here]]==
[[Category:Example description templates]]</noinclude>
</nowiki></code>

To catch difficult wiki names like C++ and C#:

<code><nowiki>
=={{header|Your Language Here|Display Name}}==
</nowiki></code>

expands to:

<code><nowiki>
==[[Your Language Here|Display Name]] [[Category:Your Language Here]]==
</nowiki></code>

Created by --[[User:IanOsgood|IanOsgood]] 10:53, 17 September 2007 (MDT)

{{template}}</noinclude>

Latest revision as of 04:20, 7 November 2019

Usage: =={{header|language name}}==

This template is intended to be used for the header of a programming language solution. The language's category is added to the task page and the Semantic MediaWiki property Implemented in language is set.

For the following languages, any of the listed spellings is ok:

  • C#: C#, C sharp or C Sharp
  • F#: F#, F sharp, F Sharp, F_sharp or F_Sharp
  • JavaScript: JavaScript or Javascript
  • Dart: Dart or Dart
  • Plain TeX: PlainTeX or plaintex or TeX or tex
  • LaTeX: LaTeX or latex

This is a template. There are many others. See Category:RCTemplates for a complete list of templates.