틀:토론인용/doc: 두 판 사이의 차이

Revi HQ
내용 추가됨 내용 삭제됨
(add indent example)
잔글 (Revi님이 틀:Talk quote block/doc 문서를 틀:토론인용/doc 문서로 이동했습니다: fix)
 
(사용자 21명의 중간 판 46개는 보이지 않습니다)
1번째 줄: 1번째 줄:
{{Documentation subpage}}
{{Documentation subpage}}
{{redirect|Template:Talkquote|quoting inline|Template:Talk quote inline}}
{{Template shortcut|tqb|tq2}}
{{Uses TemplateStyles|Template:Talk quote block/styles.css}}
<!-- Categories and interwikis go at the bottom of this page. -->
<!-- Categories and interwikis go at the bottom of this page. -->
=== Usage ===
=== Usage ===
Use this template to quote other editors comments on talk pages. It can be safely used after colon-indenting as well (see the Indenting section of [[#Examples]] below).
Use {{tnull|Talk quote block}} or {{tnull|tqb}} (a.k.a. {{tnull|Talkquote}}, {{tnull|Talk quote}}, or {{tnull|tq2}}) to quote (another's comments, a policy statement, etc.) in a block, on talk pages and noticeboards. It can be safely used after colon-indenting as well (see the [[#Indenting Indenting]] example below <sup>&#x5B;[[#Caveats|§ Caveats]]]</sup>). For a short inline quote, instead use {{tlx|Talk quote inline}} (a.k.a. {{tlx|Talk quotation}} or {{tlx|tq}}).



=== Parameters ===
=== Parameters ===
;Unnamed (positional) parameters
;Unnamed (positional) parameters
:<code><nowiki>{{talkquote|text|by}}</nowiki></code>
:<code><nowiki>{{talk quote block|text|by}}</nowiki></code>
:*'''text''' ''must'' come before '''by''' (if '''by''' is specified).
:*The order of positional parameters cannot change - ''text'' must come before ''by''.
;Using named parameters
;Using named parameters
:<code><nowiki>{{talkquote|text=text|by=by|ts=ts|diff=diff}}</nowiki></code>
:<code><nowiki>{{talk quote block|text=text|by=by|source=source|ts=ts|oldid=oldid}}</nowiki></code>
; Explanation of named parameters
: Explanation of named parameters:
:*'''text''': The text being quoted (required).
:*'''text''' (or '''1'''): The text being quoted.
:*'''by''': The author of the text being quoted (not required). '''Note''':
:*'''by''' (or '''2'''): The author of the text being quoted. A [[WP:U|Wikipedia username]] is expected, and the username will be provided as a [[WP:Link|wikilink]] to the author's user page.
:*'''diff''': The full URL of the diff showing the change that was made (not required).
:*'''source''': The source of the text being quoted. Use instead of ''by'' when source is not individual user name, or when copy-pasting an entire sig.
:*'''ts''': The timestamp of the text being quoted (not required unless <code>diff</code> is specified).
:*'''ts''': The [[WP:Timestamp|timestamp]] of the edit whose text is being quoted. Hint: You can use [[WP:5TILDES|five tildes]] to supply the current date and time: <code><nowiki>|ts=~~~~~</nowiki></code>.
:*'''oldid''': The [[WP:Revision id|revision ID]] of the edit introducing the change that was made. Displayed as the timestamp linking to the Diff of the edit. (requires ''ts'' parameter or is not shown)

:*'''diff''': The revision ID of the [[Help:Diff|Diff]] comparing target.
:*'''style''': [[HTML]] in-line style. (see the [[Template:Talk_quote_block/testcases#Parameter_"style"|testcases]])
:*'''nodash=y''' or '''no-dash=y''': Suppresses the em dash and space before ''source'', for when pasting a sig that already starts with a dash


=== Examples ===
=== Examples ===
*<code><nowiki>{{talkquote|some random text|Example}}</nowiki></code> gives:
* <code><nowiki>{{talk quote block|some random text|Example}}</nowiki></code> gives:
{{talkquote|some random text|Example}}
::<div style="background-color:#f9f9f9; border:1px dashed #3170ab; padding:10px 10px">{{talk quote block|some random text|Example}}</div>
* <code><nowiki>{{talk quote block|more random text|Example|ts=08:52, 21 May 2011 (UTC)}}</nowiki></code> gives:
::<div style="background-color:#f9f9f9; border:1px dashed #3170ab; padding:10px 10px">{{talk quote block|more random text|Example|ts=08:52, 21 May 2011 (UTC)}}</div>
* <code><nowiki>{{talk quote block|different random text|Example|ts=08:52, 21 May 2011 (UTC)|oldid=139992}}</nowiki></code> gives:
::<div style="background-color:#f9f9f9; border:1px dashed #3170ab; padding:10px 10px">{{talk quote block|different random text|Example|ts=08:52, 21 May 2011 (UTC)|oldid=139992}}</div>
::(Note: ''ts'' parameter must be present for ''oldid'' link to show)


==== Suggested boilerplate ====
*<code><nowiki>{{talkquote|more random text|Example|ts=~~~~~}}</nowiki></code> gives:
<syntaxhighlight lang="moin">
{{talkquote|more random text|Example|ts=08:52, 21 May 2011 (UTC)}}
{{tq2|1=<nowiki/>
|source=}}
</syntaxhighlight>


<syntaxhighlight lang="moin">
*<code><nowiki>{{talkquote|different random text|Example|ts=~~~~~|diff=http://en.wikipedia.org/wiki/Main_Page?diff=139992}}</nowiki></code> gives:
{{tq2|1=<nowiki/>
{{talkquote|different random text|Example|ts=08:52, 21 May 2011 (UTC)|diff=http://en.wikipedia.org/wiki/Main_Page?diff=139992}}
|by=|ts=|oldid=}}
</syntaxhighlight>


==== Indenting ====
==== Indenting ====
* The following wiki-markup:
The template works with standard talk page indentation, as the following example illustrates. This wiki-markup:
<pre>
<pre>
Random paragraph of text. [[User:Example|Example]] ([[User talk:Example|talk]]) 09:25, 21 May 2011 (UTC)
Random paragraph of text. [[User:Example|Example]] ([[User talk:Example|talk]]) 09:20, 21 May 2011 (UTC)
:Opening statement by [[User:User|Some other user]].
:Opening statement by [[User:User|Some other user]].
:{{talkquote|Quoting an item from random paragraph.}}
:{{talk quote block|Quoting an item from random paragraph.}}
:Response to quoted text. [[User:User|Some other user]] ([[User talk:User|talk]]) ~~ ~ ~~
:Response to quoted text. [[User:User|Some other user]] ([[User talk:User|talk]]) ~~~~~
</pre>
</pre>


* Gives the following:
...displays the following:
<div style="background-color:#f9f9f9; border:1px dashed #3170ab; padding:3px 10px 3px 10px">
<div style="background-color:#f9f9f9; border:1px dashed #3170ab; padding:3px 10px 3px 10px">
Random paragraph of text. [[User:Example|Example]] ([[User talk:Example|talk]]) 09:25, 21 May 2011 (UTC)
Random paragraph of text. [[User:Example|Example]] ([[User talk:Example|talk]]) 09:20, 21 May 2011 (UTC)
:Opening statement by [[User:User|Some other user]].
:Opening statement by [[User:User|Some other user]].
:{{talkquote|Quoting an item from random paragraph.}}
:{{talk quote block|Quoting an item from random paragraph.}}
:Response to quoted text. [[User:User|Some other user]] ([[User talk:User|talk]]) ~~ ~ ~~
:Response to quoted text. [[User:User|Some other user]] ([[User talk:User|talk]]) 09:26, 21 May 2011 (UTC)
</div>
</div>

==== Quoting lists ====
If the text you are quoting is a bulleted or numbered list, the first list item must start on a new line, or it won't be rendered properly. For example:
{| class="wikitable"
! Wiki-markup !! Output
|-
| '''Wrong way'''
<pre>
{{talk quote block|* Item one
* Item two
}}
</pre>
| First item isn't bulleted correctly:
<div style="background-color:#f9f9f9; border:1px dashed #3170ab; padding:3px 10px 3px 10px">
{{talk quote block|* Item one
* Item two
}}
</div>
|-
| '''Right way'''
<pre>
{{talk quote block|
* Item one
* Item two
}}
</pre>
| All items are bulleted correctly:
<div style="background-color:#f9f9f9; border:1px dashed #3170ab; padding:3px 10px 3px 10px">
{{talk quote block|
* Item one
* Item two
}}
</div>
|}

If you are using the {{para|text}} named parameter (as opposed to simply supplying your list as the first parameter) please add the following code: <code>&lt;nowiki /&gt;</code> after the <code>=</code> sign. The reason is that the MediaWiki parser automatically removes line breaks at the start of the text, causing the list to be displayed improperly otherwise. Example:
{| class="wikitable"
! Wiki-markup !! Output
|-
| '''Wrong way'''
<pre>
{{talk quote block|text=
# Item one
# Item two
}}
</pre>
| First item isn't numbered correctly:
<div style="background-color:#f9f9f9; border:1px dashed #3170ab; padding:3px 10px 3px 10px">
{{talk quote block|text=
# Item one
# Item two
}}
</div>
|-
| '''Right way'''
<pre>
{{talk quote block|text=&lt;nowiki /&gt;
# Item one
# Item two
}}
</pre>
| All items are numbered correctly:
<div style="background-color:#f9f9f9; border:1px dashed #3170ab; padding:3px 10px 3px 10px">
{{talk quote block|text=<nowiki />
# Item one
# Item two
}}
</div>
|}


=== Caveats ===
==== Complex formatting compatibility ====
<ol><li>Check [[#Quoting_lists|§ Quoting lists]], and [[Help:Table#Nested_tables|Help:Table § Nested tables]] (for nesting demo).</li>
<li>{{tq2|1=<nowiki/>{{tq2|1=<nowiki/>
'''Quoted URLs with query strings break the template'''

...

<syntaxhighlight lang="moin">
{{tq2|This here diff: https://en.wikipedia.org/w/index.php?title=User:IamNotU/sandbox&diff=904787385&oldid=904785977}}
</syntaxhighlight>

Doesn't display at all:
{{tq2|This here diff: https://en.wikipedia.org/w/index.php?title=User:IamNotU/sandbox&diff=904787385&oldid=904785977}}|by=IamNotU|ts=15:12, 4 July 2019 (UTC)|oldid=904789911}}
When your template arguments contain an equals sign, you can't use implicit positional parameters because everything preceding the first equals sign gets parsed as the parameter name. The trick, in those situations, is to make the assignment ''explicit'', so that your entire argument is unambiguously parsed as the value being assigned to that parameter.


[[wikt:IOW#Adverb|IOW]]:
<syntaxhighlight lang="moin">
{{tq2|1=This here diff: https://en.wikipedia.org/w/index.php?title=User:IamNotU/sandbox&diff=904787385&oldid=904785977}}
</syntaxhighlight>
{{tq2|1=This here diff: https://en.wikipedia.org/w/index.php?title=User:IamNotU/sandbox&diff=904787385&oldid=904785977}}


Writing the transclusion as {{tlx|tq2|2=1=...}} puts the entire URL on the right-hand side of an assignment to the first unnamed parameter, rather than it being parsed as a template parameter named <syntaxhighlight lang="moin" inline>This here diff: https://en.wikipedia.org/w/index.php?title</syntaxhighlight> that's being assigned the value <syntaxhighlight lang="moin" inline>User:IamNotU/sandbox&diff=904787385&oldid=904785977</syntaxhighlight>.|by=FeRDNYC|ts=16:25, 5 July 2019 (UTC)|oldid=904932036}}</li>
<li>Due to [[MediaWiki]]'s parsing limitations, embedding such templates into a [[Help:List|list]] (using the leading <code>*</code>/<code>#</code>/<code>;</code>/<code>:</code> syntax) is very likely to lead to unexpected results. (for it regards the [[newline]] as the syntax delimiter <sup>[Help:List §§ [[Special:PermaLink/961705865#Common_mistakes|Common mistakes]], and [[Special:PermaLink/961705865#Paragraphs_and_other_breaks|Paragraphs and other breaks]]]</sup>)</li>
<li>{{tq2|1=<nowiki/>{{tq2|1=<nowiki/>{{tq2|1=<nowiki/>
'''Play nice with ordered and unordered lists'''

* {{talkquote|Lorem ipsum}}
Is there a way to get this template to function when used at the beginning of a list item? For instance <syntaxhighlight lang="moin" inline>* {{talkquote|Lorem ipsum}}</syntaxhighlight> will turn the bullet (or number) into a regular indent, rather than showing the bullet/number. It's fine if you put something between the bullet and template, but it'd be nice if it didn't need the hack.|by=Czar|ts=23:05, 6 February 2017 (UTC)|oldid=764078325}}
As you can see by your own example above, this is now fixed. (It was fixed some time ago, I'm not sure exactly when.) Lists now play nicely with the {{tlc|tq}} templates, or vice versa. You can even colon-indent them on Talk pages, now!
:::: {{tqb|I suspect the colon-indenting was the ''real'' motivation for fixing this.|source=[[User:FeRDNYC|FeRDNYC]] ([[User talk:FeRDNYC|talk]]) 14:31, 6 July 2019 (UTC)}}|by=FeRDNYC|ts=14:31, 6 July 2019 (UTC)|oldid=905053757}}
<syntaxhighlight lang="moin">
:::: {{tqb|I suspect the colon-indenting was the ''real'' motivation for fixing this.|source=[[User:FeRDNYC|FeRDNYC]] ([[User talk:FeRDNYC|talk]]) 14:31, 6 July 2019 (UTC)}}
</syntaxhighlight>
<br/><br/>
{{tq2|1=<nowiki/>
{{cot|expand=yes|title=Ordered list, named parameter with nowiki, colon-indented following lorem ipsum paragraph}}
{{lorem ipsum}}
: {{Talk quote block|source={{tlx|Talk quote block}}|text=<nowiki />
# Item one
# Item two
}}
{{cob}}|source=[[Special:PermaLink/962402214|Template:Talk quote block/testcases]]}}
<syntaxhighlight lang="moin">
: {{Talk quote block|source={{tlx|Talk quote block}}|text=<nowiki />
# Item one
# Item two
}}
</syntaxhighlight>
<br/>
<syntaxhighlight lang="moin">
<dl><dd>{{tq2|1=<nowiki/>
# Item one
# Item two|source={{tlx|Talk quote block}}}}</dd></dl>
</syntaxhighlight>
<dl><dd>{{tq2|1=<nowiki/>
# Item one
# Item two|source={{tlx|Talk quote block}}}}</dd></dl>|source=The hack}}</li></ol>



=== See also ===
=== See also ===
{{Template:Quotation templates see also}}
{{Quotation templates}}
{{Inline talk templates}}

<includeonly>{{Sandbox other|
| <!-- Categories below this line, please: -->
[[Category:Talk namespace quotation templates]]


[[ja:Template:Talkquote]]
<includeonly>
}}</includeonly>
<!-- Categories and interwikis go here: -->
[[Category:Quotation templates]]
</includeonly>

2021년 1월 1일 (금) 06:52 기준 최신판

틀:Redirect 틀:Template shortcut 틀:Uses TemplateStyles

Usage

Use 틀:Tnull or 틀:Tnull (a.k.a. 틀:Tnull, 틀:Tnull, or 틀:Tnull) to quote (another's comments, a policy statement, etc.) in a block, on talk pages and noticeboards. It can be safely used after colon-indenting as well (see the § Indenting example below [§ Caveats]). For a short inline quote, instead use 틀:Tlx (a.k.a. 틀:Tlx or 틀:Tlx).


Parameters

Unnamed (positional) parameters
{{talk quote block|text|by}}
  • The order of positional parameters cannot change - text must come before by.
Using named parameters
{{talk quote block|text=text|by=by|source=source|ts=ts|oldid=oldid}}
Explanation of named parameters:
  • text (or 1): The text being quoted.
  • by (or 2): The author of the text being quoted. A Wikipedia username is expected, and the username will be provided as a wikilink to the author's user page.
  • source: The source of the text being quoted. Use instead of by when source is not individual user name, or when copy-pasting an entire sig.
  • ts: The timestamp of the edit whose text is being quoted. Hint: You can use five tildes to supply the current date and time: |ts=~~~~~.
  • oldid: The revision ID of the edit introducing the change that was made. Displayed as the timestamp linking to the Diff of the edit. (requires ts parameter or is not shown)
  • diff: The revision ID of the Diff comparing target.
  • style: HTML in-line style. (see the testcases)
  • nodash=y or no-dash=y: Suppresses the em dash and space before source, for when pasting a sig that already starts with a dash

Examples

  • {{talk quote block|some random text|Example}} gives:

some random text
— 사용자:Example

  • {{talk quote block|more random text|Example|ts=08:52, 21 May 2011 (UTC)}} gives:

more random text
— 사용자:Example 08:52, 21 May 2011 (UTC)

  • {{talk quote block|different random text|Example|ts=08:52, 21 May 2011 (UTC)|oldid=139992}} gives:

different random text
— 사용자:Example 08:52, 21 May 2011 (UTC)

(Note: ts parameter must be present for oldid link to show)

Suggested boilerplate

{{tq2|1=<nowiki/>
|source=}}
{{tq2|1=<nowiki/>
|by=|ts=|oldid=}}

Indenting

The template works with standard talk page indentation, as the following example illustrates. This wiki-markup:

Random paragraph of text. [[User:Example|Example]] ([[User talk:Example|talk]]) 09:20, 21 May 2011 (UTC)
:Opening statement by [[User:User|Some other user]].
:{{talk quote block|Quoting an item from random paragraph.}}
:Response to quoted text. [[User:User|Some other user]] ([[User talk:User|talk]]) ~~~~~

...displays the following:

Random paragraph of text. Example (talk) 09:20, 21 May 2011 (UTC)

Opening statement by Some other user.

Quoting an item from random paragraph.

Response to quoted text. Some other user (talk) 09:26, 21 May 2011 (UTC)

Quoting lists

If the text you are quoting is a bulleted or numbered list, the first list item must start on a new line, or it won't be rendered properly. For example:

Wiki-markup Output
Wrong way
{{talk quote block|* Item one
* Item two
}}
First item isn't bulleted correctly:

* Item one

  • Item two
Right way
{{talk quote block|
* Item one
* Item two
}}
All items are bulleted correctly:
  • Item one
  • Item two

If you are using the 틀:Para named parameter (as opposed to simply supplying your list as the first parameter) please add the following code: <nowiki /> after the = sign. The reason is that the MediaWiki parser automatically removes line breaks at the start of the text, causing the list to be displayed improperly otherwise. Example:

Wiki-markup Output
Wrong way
{{talk quote block|text=
# Item one
# Item two
}}
First item isn't numbered correctly:

# Item one

  1. Item two
Right way
{{talk quote block|text=<nowiki />
# Item one
# Item two
}}
All items are numbered correctly:
  1. Item one
  2. Item two


Caveats

Complex formatting compatibility

  1. Check § Quoting lists, and Help:Table § Nested tables (for nesting demo).
  2. 틀:Tq2
  3. Due to MediaWiki's parsing limitations, embedding such templates into a list (using the leading */#/;/: syntax) is very likely to lead to unexpected results. (for it regards the newline as the syntax delimiter [Help:List §§ Common mistakes, and Paragraphs and other breaks])
  4. 틀:Tq2


See also

틀:Quotation templates 틀:Inline talk templates