Template:Quote2/doc: Difference between revisions
Notjusttired (talk | contribs) m (unlink play) |
Notjusttired (talk | contribs) (tidy, add example with named parameters) |
||
Line 1: | Line 1: | ||
{{Documentation subpage}} | {{Documentation subpage}} | ||
== Usage == | == Usage == | ||
Line 11: | Line 10: | ||
;Unnamed (positional) parameters | ;Unnamed (positional) parameters | ||
<code><nowiki>{{quote2| | <code><nowiki>{{quote2|text|author|source}}</nowiki></code> | ||
This markup will fail if any parameter contains an equals sign (=). | This markup will fail if any parameter contains an equals sign (=). | ||
;Numbered (positional) parameters | ;Numbered (positional) parameters | ||
<code><nowiki>{{quote2|1= | <code><nowiki>{{quote2|1=text|2=author|3=source}}</nowiki></code> | ||
=== | === Examples === | ||
;Wikitext: | ;Wikitext: | ||
<code><nowiki>{{Quote2| | <code><nowiki>{{Quote2|1=Cry "Havoc" and let slip the dogs of war.|2=William Shakespeare|3=Julius Caesar (play), act III, scene I}}</nowiki></code> | ||
;Result | |||
{{Quote2|1=Cry "Havoc" and let slip the dogs of war.|2=William Shakespeare|3=Julius Caesar (play), act III, scene I}} | |||
;Wikitext: | |||
<code><nowiki>{{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}}</nowiki></code> | |||
;Result: | ;Result: | ||
{{Quote2| | {{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}} | ||
=== Restrictions === | === Restrictions === | ||
Line 57: | Line 62: | ||
}, | }, | ||
"2": { | "2": { | ||
"label": "author", | "label": "author(s)", | ||
"description": "The person who is being quoted, can be linked ", | "description": "The person who is being quoted, can be linked ", | ||
"type": "string", | "type": "string", |
Revision as of 12:07, 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 graphical speech marks.
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]