Template:Published: Difference between revisions

From ChoralWiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 2: Line 2:
                             |{{#multireplace:  {{{3|}}}  | /(\d\d\d\d)/i={{Cat|$1 works|$1}} }}{{{4|}}}}}{{#if: {{{5|}}}
                             |{{#multireplace:  {{{3|}}}  | /(\d\d\d\d)/i={{Cat|$1 works|$1}} }}{{{4|}}}}}{{#if: {{{5|}}}
                             |{{#multireplace:&#32; {{{5|}}} &#32;| /(\d\d\d\d)/i={{Cat|$1 works|$1}} }}{{{6|}}}}}<!--
                             |{{#multireplace:&#32; {{{5|}}} &#32;| /(\d\d\d\d)/i={{Cat|$1 works|$1}} }}{{{6|}}}}}<!--
-->{{#if:{{{ed|}}}|, {{#ifeq:{{#sub:{{{ed|}}}|-1}}|.|{{#sub:{{{ed|}}}|0|{{#expr:{{#len:{{{ed|}}}}}-1}}}}|{{{ed|}}}}}<!--
-->{{#if:{{{no|}}}|, no. {{#ifeq:{{#sub:{{{no|}}}|-1}}|.|{{#sub:{{{no|}}}|0|{{#expr:{{#len:{{{no|}}}}}-1}}}}|{{{no|}}}}}<!--
-->{{#if:{{{no|}}}|, no. {{#ifeq:{{#sub:{{{no|}}}|-1}}|.|{{#sub:{{{no|}}}|0|{{#expr:{{#len:{{{no|}}}}}-1}}}}|{{{no|}}}}}<!--
-->{{#if:{{{pg|}}}||.}}}}{{#if:{{{pg|}}}|, p.  {{#ifeq:{{#sub:{{{pg|}}}|-1}}|.|{{#sub:{{{pg|}}}|0<!--
-->{{#if:{{{pg|}}}||.}}}}{{#if:{{{pg|}}}|, p.  {{#ifeq:{{#sub:{{{pg|}}}|-1}}|.|{{#sub:{{{pg|}}}|0<!--
Line 8: Line 9:
This template scans the text supplied at the '''Published''' line for any four-digit year, and converts it into a link to  "category:YYYY works". The page is simultaneously included in that category. Therefore, works that have a publication date are categorized accordingly.
This template scans the text supplied at the '''Published''' line for any four-digit year, and converts it into a link to  "category:YYYY works". The page is simultaneously included in that category. Therefore, works that have a publication date are categorized accordingly.


The template accepts up to six parameters, but only the odd-numbered parameters are scanned for year numbers. Even-numbered parameters are displayed as plain text. Sometimes, there are year numbers in the text that should not be converted into a category link. For these cases, break the text in smaller parts, so that these numbers will fall in a even-numbered parameter.
'''Syntax:'''
#<tt><nowiki>{{Published|<text (scanned)>|<text (displayed as-is)>|<text (scanned)>|<text (as-is)>|<text (scanned)>|<text (as-is)>}}</nowiki></tt>
#<tt><nowiki>{{Published|<Year of first publication>|<Details>|no=NN|pg=PP}}</nowiki></tt>
#<tt><nowiki>{{Published|<Year of first publication>|<Details>|ed=<edition-volume name>}}</nowiki></tt>


There are two optional parameters, "no=" for sequential number, and "pg=" for page number(s) in the publication. So a template call like
In Syntax 1, the template accepts up to six parameters, but only the odd-numbered parameters are scanned for year numbers. Even-numbered parameters are displayed as plain text. Sometimes, there are year numbers in the text that should not be converted into a category link. For these cases, break the text in smaller parts, so that these numbers will fall in a even-numbered parameter.
:<tt><nowiki>{{Published|1501|in ''[[Harmonice Musices Odhecaton (Ottaviano Petrucci)|Harmonice Musices Odhecaton]]''|no=A18|pg=6}}</nowiki></tt> will yield:
:'''Published:''' 1501 in ''Harmonice Musices Odhecaton'', no. A18, p. 6. Notice the lack of periods (.) in the template call; the template will supply one at the end, if either "no" or "pg" are used.


A list of works available on CPDL can be created using the template {{tl|PubList}} on the appropriate {{CiteCat|Music publications|publication}} page. If there is more than one publication cited for any work, then use the template {{tl|MultiPubList}} (which requires that citation of publications on workpages use the template {{tl|Pub}} instead of {{tl|Published}}).
There are three optional parameters, "no=" for sequential number, "pg=" for page number(s) in the publication; and "ed=" for the full name of the edition or volume. The value of "ed=" must be ''exactly'' the same as the third parameter of the template {{tl|PubDatePlace}} on the publication page linked in the {{tl|Published}} template. Notice the lack of periods (.) in the template call; the template will supply one at the end, if either "no","pg", or "ed" are used.
 
Examples:


'''Syntax:'''
<tt><nowiki>{{Published|1501|in {{NoComp|Harmonice Musices Odhecaton|Ottaviano Petrucci)}}|no=A18|pg=6}}</nowiki></tt>
:{{tl|Published|<text (scanned)>|<text (displayed as-is)>|<text (scanned)>|<text (displayed as-is)>|<text (scanned)>|<text (displayed as-is)>}}
::will yield: <tt>'''Published:''' 1501 in ''Harmonice Musices Odhecaton'', no. A18, p. 6.</tt>
<tt><nowiki>{{Published|1831|in {{NoComp|The Christian Lyre|Joshua Leavitt}}|pg=104|ed=Volume 1}}</nowiki></tt>
::will yield: <tt>'''Published:''' 1831 in ''The Christian Lyre'', Volume 1, p. 104.</tt>


A list of works available on CPDL can be created using the template {{tl|PubList}} on the appropriate {{CiteCat|Music publications|publication}} page. If there is more than one publication cited for any work, then use the template {{tl|MultiPubList}} (which requires that citation of publications on workpages use the template {{tl|Pub}} instead of {{tl|Published}}).
}}
}}
[[Category:Templates]]
[[Category:Templates]]
</noinclude>
</noinclude>

Revision as of 03:35, 11 May 2019

Documentation

This template scans the text supplied at the Published line for any four-digit year, and converts it into a link to "category:YYYY works". The page is simultaneously included in that category. Therefore, works that have a publication date are categorized accordingly.

Syntax:

  1. {{Published|<text (scanned)>|<text (displayed as-is)>|<text (scanned)>|<text (as-is)>|<text (scanned)>|<text (as-is)>}}
  2. {{Published|<Year of first publication>|<Details>|no=NN|pg=PP}}
  3. {{Published|<Year of first publication>|<Details>|ed=<edition-volume name>}}

In Syntax 1, the template accepts up to six parameters, but only the odd-numbered parameters are scanned for year numbers. Even-numbered parameters are displayed as plain text. Sometimes, there are year numbers in the text that should not be converted into a category link. For these cases, break the text in smaller parts, so that these numbers will fall in a even-numbered parameter.

There are three optional parameters, "no=" for sequential number, "pg=" for page number(s) in the publication; and "ed=" for the full name of the edition or volume. The value of "ed=" must be exactly the same as the third parameter of the template {{PubDatePlace}} on the publication page linked in the {{Published}} template. Notice the lack of periods (.) in the template call; the template will supply one at the end, if either "no","pg", or "ed" are used.

Examples:

{{Published|1501|in {{NoComp|Harmonice Musices Odhecaton|Ottaviano Petrucci)}}|no=A18|pg=6}}

will yield: Published: 1501 in Harmonice Musices Odhecaton, no. A18, p. 6.

{{Published|1831|in {{NoComp|The Christian Lyre|Joshua Leavitt}}|pg=104|ed=Volume 1}}

will yield: Published: 1831 in The Christian Lyre, Volume 1, p. 104.

A list of works available on CPDL can be created using the template {{PubList}} on the appropriate publication page. If there is more than one publication cited for any work, then use the template {{MultiPubList}} (which requires that citation of publications on workpages use the template {{Pub}} instead of {{Published}}).