Difference between revisions of "Template:Cite IETF/doctypes"
Jump to navigation
Jump to search
(←Replaced content with '{{0<<>> }}<ref></ref>') |
imported>IronGargoyle m (Reverted edits by 149.62.200.45 (talk): unexplained page blanking (HG) (3.3.3)) |
||
| Line 1: | Line 1: | ||
| − | {{ | + | {{ |
| − | }}< | + | #if:{{{Id|}}} |
| + | |{{ | ||
| + | #if:{{{Idlink|}}} | ||
| + | |[[{{{Idlink}}}{{!}}{{{Id}}}]] | ||
| + | |{{{Id}}} | ||
| + | }} | ||
| + | |{{ | ||
| + | #if:{{{Std|}}}{{{Bcp|}}}{{{Fyi|}}}{{{Rfc|}}}{{{Draft|}}}{{{Ien|}}}{{{Rtr|}}} | ||
| + | |{{ | ||
| + | #if:{{{Std|}}} | ||
| + | |{{ | ||
| + | #ifeq:{{{Idlinktype|}}}|std | ||
| + | |[[{{{Idlink}}}{{!}}STD {{{Std}}}]] | ||
| + | |STD<nowiki /> {{{Std}}}}}}}{{ | ||
| + | #if:{{{Bcp|}}} | ||
| + | |{{ | ||
| + | #if:{{{Std|}}}|{{{Sep|}}} }}{{ | ||
| + | #ifeq:{{{Idlinktype|}}}|bcp | ||
| + | |[[{{{Idlink}}}{{!}}BCP {{{Bcp}}}]] | ||
| + | |BCP<nowiki /> {{{Bcp}}}}}}}{{ | ||
| + | #if:{{{Fyi|}}} | ||
| + | |{{ | ||
| + | #if:{{{Std|}}}{{{Bcp|}}}|{{{Sep|}}} }}{{ | ||
| + | #ifeq:{{{Idlinktype|}}}|fyi | ||
| + | |[[{{{Idlink}}}{{!}}FYI {{{Fyi}}}]] | ||
| + | |FYI<nowiki /> {{{Fyi}}}}}}}{{ | ||
| + | #if:{{{Rfc|}}} | ||
| + | |{{ | ||
| + | #if:{{{Std|}}}{{{Bcp|}}}{{{Fyi|}}}|{{{Sep|}}} }}{{ | ||
| + | #ifeq:{{{Idlinktype|}}}|rfc | ||
| + | |[[{{{Idlink}}}{{!}}RFC {{{Rfc}}}]] | ||
| + | |RFC<nowiki /> {{{Rfc}}}}}}}{{ | ||
| + | #if:{{{Draft|}}} | ||
| + | |{{ | ||
| + | #if:{{{Std|}}}{{{Bcp|}}}{{{Fyi|}}}{{{Rfc|}}}|{{{Sep|}}} }}{{ | ||
| + | #ifeq:{{{Idlinktype|}}}|draft | ||
| + | |[[{{{Idlink}}}{{!}}I-D {{{Draft}}}]] | ||
| + | |I-D<nowiki /> {{{Draft}}}}}}}{{ | ||
| + | #if:{{{Ien|}}} | ||
| + | |{{ | ||
| + | #if:{{{Std|}}}{{{Bcp|}}}{{{Fyi|}}}{{{Rfc|}}}{{{Draft|}}}|{{{Sep|}}} }}{{ | ||
| + | #ifeq:{{{Idlinktype|}}}|ien | ||
| + | |[[{{{Idlink}}}{{!}}IEN {{{Ien}}}]] | ||
| + | |IEN<nowiki /> {{{Ien}}}}}}}{{ | ||
| + | #if:{{{Rtr|}}} | ||
| + | |{{ | ||
| + | #if:{{{Std|}}}{{{Bcp|}}}{{{Fyi|}}}{{{Rfc|}}}{{{Draft|}}}{{{Ien|}}}|{{{Sep|}}} }}{{ | ||
| + | #ifeq:{{{Idlinktype|}}}|rtr | ||
| + | |[[{{{Idlink}}}{{!}}RTR {{{Rtr}}}]] | ||
| + | |RTR<nowiki /> {{{Rtr}}}}} | ||
| + | }} | ||
| + | }} | ||
| + | }}<noinclude>{{documentation}}</noinclude> | ||
Revision as of 19:11, 12 March 2018
This template is a "subroutine" of {{Cite IETF}} used for conditionally generating a list of associated document identifiers.
It is invoked as:
- {{Cite IETF/doctypes
- | Id = <value of
|id=parameter> - | Sep = <value of
|separator=parameter> - | Std = <value of
|std=parameter> - | Bcp = <value of
|bcp=parameter> - | Fyi = <value of
|fyi=parameter> - | Rfc = <value of
|rfc=parameter> - | Draft = <value of
|draft=parameter> - | Ien = <value of
|ien=parameter> - | Rtr = <value of
|rtr=parameter> - | Idlink = create a wikilink using this as the target, can be used to create anchor links
- | Idlinktype = document type to be used as the target text for Idlink
- | Id = <value of
- }}
It uses the following algorithm:
- If the
|Id=parameter is given the template will simply display that value. If the|Idlink=parameter is also given, it will be used to create an anchor link. - If the
|Id=parameter is not given, for the|Std=,|Bcp=,|Fyi=,|Rfc=,|Draft=,|Ien=, and|Rtr=parameters given, the template will append the document identifiers STD ## BCP ## FYI ## RFC #### I-D xxxxxx IEN ### RTR ## in this order with the numbers or identifiers passed to these parameters. - If the
|Idlink=and|Idlinktype=parameters are given they will be used to create a wikilink for the document type specified by the|Idlinktype=parameter. - The value of
|Sep=is used to separate the document identifiers: BCP 4. RFC 2119 - No trailing separator is generated; this is added after being passed to {{Citation/core}} from {{Cite IETF}}.
- The document identifier and number is separated with a <nowiki /> tag to prevent MediaWiki:Rfcurl from automatically linking RFC ####.
This "subroutine" is designed for {{Cite IETF}} and makes assumptions that may not be valid elsewhere.
Examples:
- "
{{Cite IETF/doctypes |Sep = . |Bcp = 4 |Rfc = 2119}}" produces "BCP 4. RFC 2119". - "
{{Cite IETF/doctypes |Sep = . |Bcp = 4 |Rfc = 2119 |Idlink = #IETF_RFC_2119 |Idlinktype = rfc}}" produces "BCP 4. RFC 2119". - "
{{Cite IETF/doctypes |Sep = . |Bcp = 4 |Rfc = 2119 |Idlink = #IETF_BCP_4 |Idlinktype = bcp}}" produces "BCP 4. RFC 2119".
| The above documentation is transcluded from Template:Cite IETF/doctypes/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. |