Template:Bq/doc

Usage
This template is to help facilitate the indentation of blocks of content (quotations, computer source code, etc.) with the semantically correct  element, which can also be further styled and given metadata. This method is often preferred to using wikimarkup's ";" indentation (actually an abuse of  code), and other means that can cause problems or which are complicated and error-prone, and for accessibility, content/presentation separation, semantic Web, and metadata reasons; &#91;X&#93;HTML's element has semantic meaning, while many tricks for indenting do not, or even have incorrect semantics.

Example:



which renders as:

compare to the longwinded  markup:

""

Parameters

 * text or quote or 1 (required) 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, and can also fail under other technical circumstances
 * class an additional CSS class; it already uses  by default
 * id an identifier, which can be used as a link target or for other purposes, e.g. custom user scripts; it must begin with a letter, not a number or symbol, and be unique on a page
 * style inline CSS directives for custom styling, like background color
 * title metadata that indicates 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, supports the sourcing parameters (and their aliases) of the older and simpler  templates and the frequently abused, so  can be used as a drop-in replacement for them that provides the above additional features. Conversion from several other templates, including and, even , is trivially easy. Converting from requires deletion of its first parameter, which is always   or   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.


 * 2 or sign or cite or author or by author/speaker of the quotation; this is free-form text and can including a link to the author's article.
 * 3 or source or ts source from which the quotation is drawn; this is free-form text and can including links, styling, etc.; if converting from, the author would also be included in source, but should really be moved manually to the above parameter.
 * 4 or diff optionally, you can divide the citation up further, e.g. Lastname, Firstname"Article Title"Book Title, but this is not really necessary, and is mainly to make conversion from 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 diff for conversion of.

Examples:

Working around display problems
Complex markup may require a simple trick to work around a longstanding MediaWiki bug; this is the inclusion of the code  immediately after the 1 (or text if the content following the   begins with a linebreak:
 * Lists and other complexities

This tweak unfortunately cannot be put into the template code itself, as the nowiki markup doesn't pass through the transclusion process.


 * Multiple paragraphs

Make sure that all the parameters are named (e.g. 1, etc. or with word names like 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.
 * URLs and other breakage