Difference between revisions of "Template:Cite IETF/doctypes/doc"

From blackwiki
Jump to navigation Jump to search
imported>Mogism
m (Cleanup/Typo fixing, typos fixed: seperator → separator using AWB)
imported>Zyxw
m (Since <tt> is obsolete in HTML5, replace it with <kbd> – see HTML element#tt, Wikipedia:HTML5, and mw:Help:Extension:Linter/obsolete-tag. using AWB)
Line 5: Line 5:
  
 
It is invoked as:
 
It is invoked as:
: <tt><nowiki>{{Cite IETF/doctypes</nowiki></tt>
+
: <kbd><nowiki>{{Cite IETF/doctypes</nowiki></kbd>
:: | <tt>Id</tt> = ''<value of ''{{para|id}}'' parameter>''
+
:: | <kbd>Id</kbd> = ''<value of ''{{para|id}}'' parameter>''
:: | <tt>Sep</tt> = ''<value of ''{{para|separator}}'' parameter>''
+
:: | <kbd>Sep</kbd> = ''<value of ''{{para|separator}}'' parameter>''
:: | <tt>Std</tt> = ''<value of ''{{para|std}}'' parameter>''
+
:: | <kbd>Std</kbd> = ''<value of ''{{para|std}}'' parameter>''
:: | <tt>Bcp</tt> = ''<value of ''{{para|bcp}}'' parameter>''
+
:: | <kbd>Bcp</kbd> = ''<value of ''{{para|bcp}}'' parameter>''
:: | <tt>Fyi</tt> = ''<value of ''{{para|fyi}}'' parameter>''
+
:: | <kbd>Fyi</kbd> = ''<value of ''{{para|fyi}}'' parameter>''
:: | <tt>Rfc</tt> = ''<value of ''{{para|rfc}}'' parameter>''
+
:: | <kbd>Rfc</kbd> = ''<value of ''{{para|rfc}}'' parameter>''
:: | <tt>Draft</tt> = ''<value of ''{{para|draft}}'' parameter>''
+
:: | <kbd>Draft</kbd> = ''<value of ''{{para|draft}}'' parameter>''
:: | <tt>Ien</tt> = ''<value of ''{{para|ien}}'' parameter>''
+
:: | <kbd>Ien</kbd> = ''<value of ''{{para|ien}}'' parameter>''
:: | <tt>Rtr</tt> = ''<value of ''{{para|rtr}}'' parameter>''
+
:: | <kbd>Rtr</kbd> = ''<value of ''{{para|rtr}}'' parameter>''
:: | <tt>Idlink</tt> = create a wikilink using this as the target, can be used to create anchor links
+
:: | <kbd>Idlink</kbd> = create a wikilink using this as the target, can be used to create anchor links
:: | <tt>Idlinktype</tt> = document type to be used as the target text for Idlink
+
:: | <kbd>Idlinktype</kbd> = document type to be used as the target text for Idlink
: <tt><nowiki>}}</nowiki></tt>
+
: <kbd><nowiki>}}</nowiki></kbd>
  
 
It uses the following algorithm:
 
It uses the following algorithm:
 
# If the {{para|Id}} parameter is given the template will simply display that value. If the {{para|Idlink}} parameter is also given, it will be used to create an anchor link.
 
# If the {{para|Id}} parameter is given the template will simply display that value. If the {{para|Idlink}} parameter is also given, it will be used to create an anchor link.
# If the {{para|Id}} parameter is not given, for the {{para|Std}}, {{para|Bcp}}, {{para|Fyi}}, {{para|Rfc}}, {{para|Draft}}, {{para|Ien}}, and {{para|Rtr}} parameters given, the template will append the document identifiers <tt>STD ##</tt> <tt>BCP ##</tt> <tt>FYI ##</tt> <tt>RFC ####</tt> <tt>I-D xxxxxx</tt> <tt>IEN ###</tt> <tt>RTR ##</tt> in this order with the numbers or identifiers passed to these parameters.
+
# If the {{para|Id}} parameter is not given, for the {{para|Std}}, {{para|Bcp}}, {{para|Fyi}}, {{para|Rfc}}, {{para|Draft}}, {{para|Ien}}, and {{para|Rtr}} parameters given, the template will append the document identifiers <kbd>STD ##</kbd> <kbd>BCP ##</kbd> <kbd>FYI ##</kbd> <kbd>RFC ####</kbd> <kbd>I-D xxxxxx</kbd> <kbd>IEN ###</kbd> <kbd>RTR ##</kbd> in this order with the numbers or identifiers passed to these parameters.
 
# If the {{para|Idlink}} and {{para|Idlinktype}} parameters are given they will be used to create a wikilink for the document type specified by the {{para|Idlinktype}} parameter.
 
# If the {{para|Idlink}} and {{para|Idlinktype}} parameters are given they will be used to create a wikilink for the document type specified by the {{para|Idlinktype}} parameter.
# The value of {{para|Sep}} is used to separate the document identifiers: <tt><nowiki>BCP 4. RFC 2119</nowiki></tt>
+
# The value of {{para|Sep}} is used to separate the document identifiers: <kbd><nowiki>BCP 4. RFC 2119</nowiki></kbd>
 
# No trailing separator is generated; this is added after being passed to {{tl|Citation/core}} from {{tl|Cite IETF}}.
 
# No trailing separator is generated; this is added after being passed to {{tl|Citation/core}} from {{tl|Cite IETF}}.
 
# The document identifier and number is separated with a &lt;nowiki /&gt; tag to prevent [[MediaWiki:Rfcurl]] from automatically linking RFC<nowiki /> ####.
 
# The document identifier and number is separated with a &lt;nowiki /&gt; tag to prevent [[MediaWiki:Rfcurl]] from automatically linking RFC<nowiki /> ####.

Revision as of 06:21, 5 August 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
}}

It uses the following algorithm:

  1. 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.
  2. 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.
  3. 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.
  4. The value of |Sep= is used to separate the document identifiers: BCP 4. RFC 2119
  5. No trailing separator is generated; this is added after being passed to {{Citation/core}} from {{Cite IETF}}.
  6. 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".