Template:Tag: Difference between revisions
Jump to navigation
Jump to search
[unchecked revision] | [checked revision] |
No edit summary |
(added GEN to switch to support links into generic section) |
||
(5 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
<includeonly>< | <includeonly>{{#vardefine:slug|{{#switch:{{{1}}} | ||
|is=IS | |||
|co=CO | |||
|tt=TT | |||
|rs=RS | |||
|rtm=RTM | |||
|GEN=Generic | |||
|#default={{{1}}}}}}}<!-- | |||
Ende slug | |||
-->{{#vardefine:target|{{#if:{{{@|}}}|{{{@}}}}}{{#if:{{{attr|}}}|{{{attr}}}}}{{#if:{{{#|}}}|{{{#}}}}}}}<tt><{{Doc|{{#var:slug}}|{{{2}}}|{{{3|}}}|attr={{#var:target}}|ex={{{ex|}}}|semcon={{{semcon|}}}|wiki={{{wiki|}}}}}>{{#if:{{{@|}}}|@{{{@}}}}}{{#if:{{{#|}}}|<nowiki>#</nowiki>{{{#}}}}}</tt></includeonly><noinclude>==Usage== | |||
Template Tag standardizes the depiction of element names. | Template Tag standardizes the depiction of element names. | ||
===Arguments=== | ===Arguments=== | ||
Line 10: | Line 19: | ||
**attr: an attribute. If this argument is used, the link will lead directly to a certain attribute of the target element | **attr: an attribute. If this argument is used, the link will lead directly to a certain attribute of the target element | ||
**@: an attribute that will both be linked and named | **@: an attribute that will both be linked and named | ||
**<nowiki />#: an enumeration value to be linked and named | |||
**wiki: 2 for the {{rml|2}} wiki; 3 for the {{rml|3}} wiki. Empty, if valid for both wikis. | **wiki: 2 for the {{rml|2}} wiki; 3 for the {{rml|3}} wiki. Empty, if valid for both wikis. | ||
**ex: If existing, the subschema-slag is shown. | |||
==Example== | ==Example== | ||
<pre>{{Tag|GEN|bitmaskValidity}}</pre> | |||
produces | |||
{{Tag|GEN|bitmaskValidity}} | |||
<pre>{{Tag|IS|track|attr=name}}</pre> | <pre>{{Tag|IS|track|attr=name}}</pre> | ||
produces | produces | ||
Line 24: | Line 41: | ||
{{Tag|IS|track|@=name|ex=1}} | {{Tag|IS|track|@=name|ex=1}} | ||
<pre>{{Tag|IS|border|#=tarif|ex=1}}</pre> | |||
produces | |||
{{Tag|IS|border|#=tarif|ex=1}} | |||
<pre>{{tag|TT|organizationalUnitBinding|trainPart|wiki=2}}</pre>delivers: | |||
{{tag|TT|organizationalUnitBinding|trainPart|wiki=2}} | |||
<pre>{{tag|TT|activities|stop|wiki=3}}</pre> | |||
{{tag|TT|activities|stop|wiki=3}} | |||
<pre>{{tag|TT|ocpTT|wiki=2|semcon=TT:002}}</pre> | |||
{{tag|TT|ocpTT|wiki=2|semcon=TT:002}} | |||
{{interwiki}} | |||
[[Category:LinkTemplate]]</noinclude> | [[Category:LinkTemplate]]</noinclude> |
Latest revision as of 15:54, 7 March 2024
Usage
Template Tag standardizes the depiction of element names.
Arguments
This template has three arguments:
- obligatory
- 1: the subschema – CO, IL, IS, RS or TT
- 2: the element name
- optional
- 3: the parent, as in this wiki some elements share their names with each other
- attr: an attribute. If this argument is used, the link will lead directly to a certain attribute of the target element
- @: an attribute that will both be linked and named
- #: an enumeration value to be linked and named
- wiki: 2 for the railML® 2 wiki; 3 for the railML® 3 wiki. Empty, if valid for both wikis.
- ex: If existing, the subschema-slag is shown.
Example
{{Tag|GEN|bitmaskValidity}}
produces
{{Tag|IS|track|attr=name}}
produces
<track>
{{Tag|IS|track|@=name}}
produces
<track>@name
{{Tag|IS|track|@=name|ex=1}}
produces
<IS:track>@name
{{Tag|IS|border|#=tarif|ex=1}}
produces
<IS:border>#tarif
{{tag|TT|organizationalUnitBinding|trainPart|wiki=2}}
delivers:
{{tag|TT|activities|stop|wiki=3}}
{{tag|TT|ocpTT|wiki=2|semcon=TT:002}}
<ocpTT>