Template:Quote2/doc: Difference between revisions
Notjusttired (talk | contribs) (tidy, add example with named parameters) |
Notjusttired (talk | contribs) m (consolidate template data) |
||
Line 48: | Line 48: | ||
<templatedata> | <templatedata> | ||
{ | { | ||
"description": "Adds a quote with | "description": "Adds a quote with a large quotation mark, without a title", | ||
"format": "inline", | |||
"params": { | "params": { | ||
"1": { | "1": { |
Revision as of 13:02, August 13, 2021
This is a documentation subpage for Template:Quote2. It contains usage information, categories and other content that is not part of the original template page. |
Usage[edit source]
{{Quote2}}
adds a block quotation to an article page.
Note: Block quotes do not normally contain quotation marks. See Manual of style.
Synopsis[edit source]
- Unnamed (positional) parameters
{{quote2|text|author|source}}
This markup will fail if any parameter contains an equals sign (=).
- Numbered (positional) parameters
{{quote2|1=text|2=author|3=source}}
Examples[edit source]
- Wikitext
{{Quote2|1=Cry "Havoc" and let slip the dogs of war.|2=William Shakespeare|3=Julius Caesar (play), act III, scene I}}
- Result
“ | Cry "Havoc" and let slip the dogs of war. | ” |
—William Shakespeare, Julius Caesar (play), act III, scene I |
- Wikitext
{{Quote2|text=We are told not to worry about breakthrough cases because they are ‘mild’ – but long Covid is anything but mild|author=Hannah Davis|source=The Guardian}}
- Result
“ | We are told not to worry about breakthrough cases because they are ‘mild’ – but long Covid is anything but mild | ” |
—Hannah Davis, The Guardian |
Restrictions[edit source]
If you do not provide quoted text, the template generates a parser error message, which will appear in red text in the rendered page.
If any parameter's actual value contains an equals sign (=), you must use named parameters. (The equals sign gets interpreted as a named parameter otherwise.)
If any parameter's actual value contains characters used for wiki markup syntax (such as pipe, brackets, single quotation marks, etc.), you may need to escape it. See Template:! and friends.
Be wary of URLs which contain restricted characters. The equals sign is especially common.
Multiple paragraphs[edit source]
The <blockquote>
element and any templates that use it do not honor newlines:
Markup | Renders as |
---|---|
|
|
The simplest workaround for this is to use the <poem>
tag inside <blockquote>
, which will convert line breaks to <br />
tags:
Markup | Renders as |
---|---|
|
|
TemplateData[edit source]
TemplateData for Quote2
Adds a quote with a large quotation mark, without a title
Parameter | Description | Type | Status | |
---|---|---|---|---|
text | 1 1 quote | The text to quote | String | required |
author(s) | 2 2 person author | The person who is being quoted, can be linked
| String | suggested |
source | 3 3 book article | A source for the quote - book, article, etc
| String | suggested |
See also[edit source]