User:Rpclod/Patent Templates/Citation
This page is part of my attempt to understand how templates work and hopefully improve certain templates or their documentation. This page is a subset of my particular focus on patent citation templates.
As of 2008-11-26, the Citation template calls the Citation/patent template using the following parameters:
{{Citation/patent
|Surname1 = {{{inventor-surname|{{{inventor1-surname|{{{inventor-last|{{{inventor1-last|{{{inventor}}}}}}}}}}}}}}}
|Surname2={{{inventor2-surname|{{{inventor2-last|{{{inventor2|}}}}}}}}}
|Surname3={{{inventor3-surname|{{{inventor3-last|{{{inventor3|}}}}}}}}}
|Surname4={{{inventor4-surname|{{{inventor4-last|{{{inventor4|}}}}}}}}}
|Given1 = {{{inventor-given|{{{inventor1-given|{{{inventor-first|{{{inventor1-first|}}}}}}}}}}}}
|Given2={{{inventor2-given|{{{inventor2-first|}}}}}}
|Given3={{{inventor3-given|{{{inventor3-first|}}}}}}
|Given4={{{inventor4-given|{{{inventor4-first|}}}}}}
|Inventorlink1={{{inventorlink1|{{{inventorlink|}}}}}}
|Inventorlink2={{{inventorlink2|}}}
|Inventorlink3={{{inventorlink3|}}}
|Inventorlink4={{{inventorlink4|}}}
|Title={{{title|}}}
|CountryCode={{{country-code}}}
|PublicationNumber={{{publication-number|{{{patent-number}}}}}}
|Description={{{description|}}}
|PublicationDate={{{publication-date|}}}
|IssueDate={{{issue-date|}}}
|Year={{{year}}}
}}
In the absence of any other information, I assume the above is a complete list of the parameters for the Citation/patent template. The Citation template discussion page indicates that, when using the citation template to cite patents, inventor-last is the only required parameter.
As of 2008-11-26, the Citation/patent template begins with the following:
<cite style="font-style:normal" {{#if:{{{Ref|}}}
|{{#ifeq:{{{Ref|}}}|none||id="{{{Ref|}}}"}}
|{{#if:{{{Surname1}}}
|id="CITEREF{{{Surname1}}}{{{Surname2|}}}{{{Surname3|}}}{{{Surname4|}}}{{{Year}}}"
}}
}}>
Don't look at my wikitext source for the above as I had to use some real kludges to make this appear the same as on the template's "view source" page. But if you do view my source and have any ideas how to display well-formatted code without hardcoding spaces, please let me know.
<CITE> is a start HTML tag. (The end tag is found later in the template.) The CITE tag typically contains the source name for subsequently referenced information. It does not have any required attributes. The first line of citation/patent code uses two optional attributes, style and id. These are common attributes that can be used in most HTML tags. (After HTML 2.0, the style attribute was deprecated, except as to inline, internal or external style sheets.[1][2][3][4] However, I do not know the extent to which CSS is implemented within Wikipedia.) The style attribute is used in the Citation/patent template as follows:
style="font-style:normal"
Typically browsers render text contained within the CITE tag in italics. I assume that the purpose of using the style attribute in this manner is to override the typical rendering and use normal, rather than italic, font. However, this begs the question of why the CITE tag is used in the first place. If the text appears normal, why not just transclude the text itself rather than embed it within a CITE tag? I am somewhat surprised that the title attribute is not used. It provides a short description of the element that is shown as a "tool tip" when the mouse hovers over the element.
Because the id attribute is embedded within a complex Wikimedia parser function structure, a discussion of the parser function structure will precede a discussion of the id attribute.[5]
The structure begins with a two braces or curly brackets. The double brace directs Wikimedia to transclude a template. The next item is an #if parser function which defines the transcluded content. #if is a parser function contained in the ParserFunctions collection. The syntax for #if is:
{{ #if: <condition string> | <code if true> | <code if false> }}
The condition string for the outermost #if statement appears to be {{{Ref|}}}. The triple brace {{{ indicates a parameter that is passed to the template from its caller. Whence came "Ref"? It is not listed by the Citation template as a parameter passed to the Citation/patent template. A ref template exists, but that would require a double brace, not a triple brace. Further a REF tag exists in HTML, but the angle brackets are missing. Also, why does the pipe character "|" immediately follow "Ref" (especially when more piping follows the closing curly brackets)? I assume that "Ref" is an undefined parameter without a default value.
# ifeq is a parser function contained in the ParserFunctions collection. The syntax for #ifeq is:
{{ #ifeq: <text 1> | <text 2> | <code if equal> | <code if not equal> }}
The "id" attribute assigns an identifier to the associated element.
If the link points to the document in which the link is embedded, the link appears in bold and does not appear as a hyperlink.
The call to the Link template creates a link to the European Patent Office website at http://v3.espacenet.com.
References
[edit]- ^ Dave Raggett, ed. (1999-12-24). "Appendix A: Changes". HTML 4.01 Specification. W3C. Retrieved 2008-12-01.
Almost all attributes that specify the presentation of an HTML document (e.g., colors, alignment, fonts, graphics, etc.) have been deprecated in favor of style sheets.
- ^ "Style Sheets, Inline style information". HTML 4.01 Specification. W3C. 1999-12-24. Retrieved 2008-12-01.
The syntax of the value of the style attribute is determined by the default style sheet language.
While the style attribute remains, use outside of style sheet language is deprecated. - ^ Tantek Çelik, ed. (2002-05-15). "Syntax of CSS rules in HTML's "style" attribute". W3C. Retrieved 2008-12-01.
- ^ Raggett, Dave (2002-04-08). "Adding a touch of style". W3C. Retrieved 2008-12-01.
- ^ "The global structure of an HTML document, Element identifiers: the id and class attributes". HTML 4.01 Specification. W3C. 1999-12-24. Retrieved 2008-12-01.