Difference between revisions of "Template:Cite IETF/refanchor"
Jump to navigation
Jump to search
imported>Tothwolf m (Rm whitespace fix) |
imported>Tothwolf (Prefer IETF document types over Id parameter; fall back to Id parameter if no other document types are present) |
||
| Line 2: | Line 2: | ||
#if:{{{Prefix|}}} | #if:{{{Prefix|}}} | ||
|{{ | |{{ | ||
| − | #if:{{{ | + | #if:{{{Rfc|}}}{{{Std|}}}{{{Bcp|}}}{{{Fyi|}}}{{{Draft|}}}{{{Ien|}}}{{{Rtr|}}}{{{Id|}}} |
| − | |{{{Prefix}}} | + | |{{{Prefix}}}_ |
}} | }} | ||
}}{{ | }}{{ | ||
| − | #if:{{{ | + | #if:{{{Rfc|}}} |
| − | |{{{ | + | |RFC{{{Sep|}}} {{{Rfc}}} |
|{{ | |{{ | ||
| − | #if:{{{ | + | #if:{{{Std|}}} |
| − | | | + | |STD{{{Sep|}}} {{{Std}}} |
|{{ | |{{ | ||
| − | #if:{{{ | + | #if:{{{Bcp|}}} |
| − | | | + | |BCP{{{Sep|}}} {{{Bcp}}} |
|{{ | |{{ | ||
| − | #if:{{{ | + | #if:{{{Fyi|}}} |
| − | | | + | |FYI{{{Sep|}}} {{{Fyi}}} |
|{{ | |{{ | ||
| − | #if:{{{ | + | #if:{{{Draft|}}} |
| − | | | + | |I-D{{{Sep|}}} {{{Draft}}} |
|{{ | |{{ | ||
| − | #if:{{{ | + | #if:{{{Ien|}}} |
| − | | | + | |IEN{{{Sep|}}} {{{Ien}}} |
|{{ | |{{ | ||
| − | #if:{{{ | + | #if:{{{Rtr|}}} |
| − | | | + | |RTR{{{Sep|}}} {{{Rtr}}} |
| − | | | + | |{{{Id|}}} |
| − | |||
| − | |||
| − | |||
}} | }} | ||
}} | }} | ||
Latest revision as of 21:58, 7 November 2009
This template is a "subroutine" of {{Cite IETF}} used for conditionally generating an anchor name.
It is invoked as:
- {{Cite IETF/refanchor
- | Prefix = text used to prefix template result
- | Sep = text used to separate the document type and identifier
- | Id = <value of
|id=parameter> - | Rfc = <value of
|rfc=parameter> - | Std = <value of
|std=parameter> - | Bcp = <value of
|bcp=parameter> - | Fyi = <value of
|fyi=parameter> - | Draft = <value of
|draft=parameter> - | Ien = <value of
|ien=parameter> - | Rtr = <value of
|rtr=parameter>
- }}
It uses the following algorithm:
- If any of
|Rfc=,|Std=,|Bcp=,|Fyi=,|Draft=,|Ien=, or|Rtr=parameters are given, the template will display one of those parameter types and the associated value. - The template will give priority to the first of the parameters:
|Rfc=,|Std=,|Bcp=,|Fyi=,|Draft=,|Ien=, or|Rtr=in this order and use the first matching parameter. - If none of the above parameters are given and the
|Id=parameter is given the template will simply display that value. - If the
|Prefix=parameter is given the template output is prefixed with this value. - If the
|Sep=parameter is given, this value will be placed between the document type and identifier.
This "subroutine" is designed for {{Cite IETF}} and makes assumptions that may not be valid elsewhere.
Examples:
- "
{{Cite IETF/refanchor |Prefix = IETF |Rfc = 2119 |Bcp = 4}}" produces "IETF_RFC 2119". - "
{{Cite IETF/refanchor |Rfc = 2119}}" produces "RFC 2119".
| The above documentation is transcluded from Template:Cite IETF/refanchor/doc. (edit | history) Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |