Difference between revisions of "Template:Bq/doc"

From blackwiki
Jump to navigation Jump to search
imported>Sardanaphalus
(template updates, some formatting)
imported>Frietjes
(per tfd)
 
Line 1: Line 1:
{{Documentation subpage}}
+
#REDIRECT [[Template:Quote/doc]]
<!-- PLEASE ADD CATEGORIES WHERE INDICATED AT THE BOTTOM OF THIS PAGE -->
 
 
 
This template is to help facilitate the indentation of blocks of content (quotations, computer source code, etc.) with the [[Semantic markup|semantically correct]] {{tag|blockquote}} element, which can also be further styled and given metadata. This method is often preferred to using wikimarkup's ";" indentation (actually an abuse of {{tag|dt}} code), and other means that can cause problems or which are complicated and error-prone, and for [[WP:Accessibility|accessibility]], [[Separation of presentation and content|content/presentation separation]], [[semantic Web]], and [[WP:METADATA|metadata]] reasons; &#91;[[XHTML|X]]&#93;[[HTML]]'s {{tag|blockquote|open=y}} element has semantic meaning, while many tricks for indenting do not, or even have incorrect semantics.
 
 
 
'''Example using {{tpad|bq}}'''
 
{{Markupv
 
| markup = <nowiki>{{bq |text=Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.}}</nowiki>
 
| renders = {{bq |text=Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.}}
 
}}
 
 
 
'''Example using <nowiki><blockquote></nowiki>'''
 
{{Markupv
 
| markup = <nowiki><blockquote>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</blockquote></nowiki>
 
| renders = <blockquote>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</blockquote>
 
}}
 
 
 
===Parameters===
 
; {{para|text}}{{\}}{{para|quote}}{{\}}{{para|1}} : ''(required)''&nbsp; The content of the indented block; it is always safest to specify this parameter explicitly, as it will otherwise break if the content ever contains the "=" character. It can also fail under other technical circumstances.
 
; {{para|class}} : Additional CSS class[es?] (the class <code>templatequote</code> already used by default).
 
; {{para|id}}    : Identifier for use as e.g. a link target or by custom custom user scripts. It must begin with a letter, not a number or symbol, and be unique on a page.
 
; {{para|style}} : Inline CSS directives for custom styling (e.g. background:...)
 
; {{para|title}} : For metadata indicating a title or label for the element. Different browsers handle this differently, most often as a pop-up tooltip on mouseover.
 
 
 
===Cited quotations===
 
For use with cited quotations, {{tnull|bq}} supports the sourcing parameters (and their aliases) of the older and simpler {{tlx|quote}} templates and the frequently abused {{tlx|cquote}}, so {{tnull|bq}} can be used as a drop-in replacement for them that provides the above additional features. Conversion from several other templates, including {{tlx|quote box}} and {{tlx|quotation}}, even {{tlx|talkquote}}, is trivially easy. Converting from {{tlx|rquote}} requires deletion of its first parameter, which is always <code>left</code> or <code>right</code> and then the rest of its data will just work without modification. Such conversions of course lose features (decoration, etc.) of many of those templates, but sometimes that is precisely what is desired.
 
* {{para|2}} or {{para|sign}} or {{para|cite}} or {{para|author}} or {{para|by}} author/speaker of the quotation; this is free-form text and can include a link to the author's article.
 
* {{para|3}} or {{para|source}} or {{para|ts}} source from which the quotation is drawn; this is free-form text and can including links, styling, etc.; if converting from {{tlx|quote box}}, the author would also be included in {{para|source}}, but should really be moved manually to the above parameter.
 
* {{para|4}} optionally, you can divide the citation up further, e.g. {{para|2|Lastname, Firstname}}{{para|3|"Article Title"}}{{para|4|Book Title}}, but this is not really necessary, and is mainly to make conversion from {{tlx|quotation}} a little easier. Parameter 4 is automatically italicized, since it is only used for larger works like books, albums, magazines, or TV shows. It also maps to {{para|diff}} for conversion of {{tlx|talkquote}}.
 
 
 
'''Examples'''
 
{{Markupv
 
| markup = <nowiki>{{bq |text=Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. |sign=Anne O. Nymus |source=<cite>The Unlightable Being of Bareness</cite>, 1992, p. 37}}</nowiki>
 
| renders = {{bq |text=Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. |sign=Anne O. Nymus |source=<cite>The Unlightable Being of Bareness</cite>, 1992, p. 37}}
 
}}
 
{{Markupv
 
| markup = <nowiki>{{bq |text=Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. |2=Anne O. Nymus |3=1992, "Introduction", pp. vii–ix |4=<cite>The Unlightable Being of Bareness</cite>}}</nowiki>
 
| renders = {{bq |text=Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. |2=Anne O. Nymus |3=1992, "Introduction", pp. vii–ix |4=<cite>The Unlightable Being of Bareness</cite>}}
 
}}
 
 
 
===Working around display problems===
 
'''Lists and other complexities'''<br/>
 
Complex markup may require a simple trick to work around a longstanding MediaWiki bug; this is the inclusion of the code <code>&lt;nowiki /&gt;</code> immediately after the {{para|1}} (or {{para|text}} if the content following the <code>=</code> begins with a linebreak:
 
 
 
{{Markup |title=This fails:
 
| <nowiki>{{bq |1=
 
* Foo
 
* Bar
 
* Baz
 
}}</nowiki>
 
| {{bq |1=
 
* Foo
 
* Bar
 
* Baz
 
}}
 
}}
 
{{Markup |title=This works correctly:
 
|<nowiki> {{bq |1=&lt;nowiki /&gt;
 
* Foo
 
* Bar
 
* Baz
 
}}</nowiki>
 
| {{bq|1=<nowiki />
 
* Foo
 
* Bar
 
* Baz
 
}}
 
}}
 
 
 
This tweak unfortunately cannot be put into the template code itself, as the {{tag|nowiki|s}} markup doesn't pass through the transclusion process.
 
 
 
'''Multiple paragraphs'''
 
{{Blockquote paragraphs}}
 
 
 
'''URLs and other breakage'''<br/>
 
Make sure that all the parameters are named (e.g. {{para|1}}, etc. or with word names like {{para|source}}). Many URLs, and plenty of other things, contain the "=" character, which due to [[MediaWiki]] limitations, will cause the template to malfunction if used in an unnamed parameter.
 
 
 
 
 
{{Quotation templates}}
 
{{Semantic markup templates}}
 
 
 
{{When on basepage
 
| <!-- ADD CATEGORIES BELOW THIS LINE, PLEASE: -->
 
[[Category:Quotation templates]]
 
[[Category:Programming typing-aid templates]]
 
[[Category:Semantic markup templates]]
 
[[Category:Wikipedia XHTML tag-replacing templates]]
 
}}
 

Latest revision as of 15:20, 9 February 2015

Redirect to: