Template:Published: Difference between revisions
Richard Mix (talk | contribs) (16th ''century'') |
No edit summary |
||
Line 1: | Line 1: | ||
<includeonly>'''Published:''' {{#multireplace:  {{{1|}}}  | /(\d\d\d\d)/i={{Cat|$1 works|$1}} }}{{{2|}}}{{#if: {{{3|}}} | <includeonly>'''Published:''' {{#multireplace:  {{{1|}}}  | /(\d\d\d\d)/i={{Cat|$1 works|$1}} }}{{{2|}}}{{#if: {{{3|}}} | ||
|{{#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:  {{{5|}}}  | /(\d\d\d\d)/i={{Cat|$1 works|$1}} }}{{{6|}}}}}</includeonly><noinclude><!-- | |{{#multireplace:  {{{5|}}}  | /(\d\d\d\d)/i={{Cat|$1 works|$1}} }}{{{6|}}}}}<!-- | ||
-->{{#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<!-- | |||
-->|{{#expr:{{#len:{{{pg|}}}}}-1}}}}|{{{pg|}}}}}.}}</includeonly><noinclude><!-- | |||
-->{{Doc|1= | -->{{Doc|1= | ||
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. | ||
Line 9: | Line 12: | ||
There are two optional parameters, "no=" for sequential number, and "pg=" for page number(s) in the publication. So a template call like | There are two optional parameters, "no=" for sequential number, and "pg=" for page number(s) in the publication. So a template call like | ||
:<tt><nowiki>{{Published|1501|in ''[[Harmonice Musices Odhecaton (Ottaviano Petrucci)|Harmonice Musices Odhecaton]]''|no=A18|pg=6}}</nowiki></tt> will yield: | :<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. | :'''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. | ||
'''Syntax:''' | '''Syntax:''' |
Revision as of 02:53, 9 January 2019
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.
There are two optional parameters, "no=" for sequential number, and "pg=" for page number(s) in the publication. So a template call like
- {{Published|1501|in ''[[Harmonice Musices Odhecaton (Ottaviano Petrucci)|Harmonice Musices Odhecaton]]''|no=A18|pg=6}} 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.
Syntax:
- {{Published|<text (scanned)>|<text (displayed as-is)>|<text (scanned)>|<text (displayed as-is)>|<text (scanned)>|<text (displayed as-is)>}}