Jump to content

Template:Header beta: Difference between revisions

(1) Try to make {{header|C#}} act like {{header|C sharp}}. Like for F#. (2) Use category F Sharp (uppercase S), not F sharp.
m (Shouldn't be in the C# category)
((1) Try to make {{header|C#}} act like {{header|C sharp}}. Like for F#. (2) Use category F Sharp (uppercase S), not F sharp.)
Line 1:
{{#if: {{{2|}}}
{{#if: {{{2|}}} | <span id="{{{1}}}">[[:Category:{{{1}}}|{{{2}}}]]</span>|{{#switch: {{lc: {{{1|}}} }}|c sharp=<span id="C sharp">[[:Category:C sharp|C#]]</span>|f sharp=<span id="F sharp">[[:Category:F sharp|F#]]</span>|[[:Category:{{{1}}}|{{{1}}}]]}} }}[[Category:{{{1}}}]]{{#set:implemented in language={{{1}}} }}<noinclude>
| <span id="{{{1}}}">[[:Category:{{{1}}}|{{{2}}}]]</span>
|{{#switch: {{lc: {{{1|}}} }}
|c#|c sharp=<span id="C sharp">[[:Category:C sharp|C#]]</span>
|f#|f sharp=<span id="F sharp">[[:Category:F Sharp|F#]]</span>
|[[:Category:{{{1}}}|{{{1}}}]]}}
}} [[Category:{{{1}}}]]{{#set:implemented in language={{{1}}}
}}</noinclude>
 
This is intended to be used...
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:
 
<code><nowiki>
=={{header|Your Language Here}}==
</nowiki></code>
 
expands to:
<code><nowiki>
==[[Your Language Here]] [[Category:Your Language Here]]==
</nowiki></code>
 
To catch difficult wiki names like 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>
</noinclude>
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.