User:Harrystein/sandbox/template/MIA citation/5: Difference between revisions

From Leftypedia
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
 
(17 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{#tag:ref|<!--
<noinclude>
-->[[Karl Marx|Marx, Karl]]{{#ifeq:{{{volume|}}}|1|| & [[Friedrich Engels|Engels, Friedrich]]}} ({{trim|{{array|get|1867,1885,1894|,|{{{volume|}}}}}}}). ''[[Das Kapital, Volume {{trim|{{array|get|I,II,III|,|{{{volume|}}}}}}}|Capital, Volume {{trim|{{array|get|I,II,III|,|{{{volume|}}}}}}}]]'', Chapter {{{chapter|}}}: [[Das Kapital, Volume {{trim|{{array|get|I,II,III|,|{{{volume|}}}}}}}, Chapter <!--
'''Special case citer.''' Primarily intended for sub-template use by forthcoming MIA cite template, but also may come in handy when called directly.
Next: Capitalize e.g. Twenty-eight to Twenty-Eight.
1 = work e.g. capital
-->{{#if: {{switch by pattern|_input={{{chapter|}}}|true=[^1][1-9]|_default=}}
2 = volume e.g. 1
| {{ucfirst:{{string split|{{number to word|{{{chapter|}}}}}|-}}}}-{{ucfirst:{{string split|{{number to word|{{{chapter|}}}}}|-|2}}}}
3 = chapter e.g. 3
| {{ucfirst:{{number to word|{{{chapter|}}}}}}}
4 = link e.g. https:// etc. etc.
}}<!--
 
Rest of the wikilink, i.e. the chapter title in the link target, plus the alias (chapter title).
'''This has now been implemented at [[Template:MIA citation/special]]'''
-->: {{user:Harrystein/sandbox/template/MIA citation/4|{{{volume|}}}|{{{chapter|}}}}}|"{{user:Harrystein/sandbox/template/MIA citation/4|{{{volume|}}}|{{{chapter|}}}}}."]]
 
}}
</noinclude>{{#switch:{{{work|{{{1|capital}}}}}}<!--
 
1. Capital
-->| capital = [[Karl Marx|Marx, Karl]]{{#ifeq:{{{volume|{{{2|}}}}}}|1||{{nbsp}}&{{nbsp}}[[Friedrich Engels|Engels, Friedrich]]}} ({{trim|{{array|get|1867,1885,1894|,|{{{volume|{{{2|}}}}}}}}}}). ''[[Das Kapital, Volume {{trim|{{array|get|I,II,III|,|{{{volume|{{{2|}}}}}}}}}}|Capital, Volume {{trim|{{array|get|I,II,III|,|{{{volume|{{{2|}}}}}}}}}}.]]'' Chapter {{{chapter|{{{3|}}}}}}: [[Das Kapital, Volume {{trim|{{array|get|I,II,III|,|{{{volume|{{{2|}}}}}}}}}}, Chapter <!--
 
1.1: Next: Capitalize numerals, e.g. Twenty-eight to Twenty-Eight.
-->{{#if: {{switch by pattern|_input={{{chapter|{{{3|}}}}}}|true=[^1][1-9]|_default=}}
  | {{ucfirst:{{string split|{{number to word|{{{chapter|{{{3|}}}}}}}}|-}}}}-{{ucfirst:{{string split|{{number to word|{{{chapter|{{{3|}}}}}}}}|-|2}}}}
  | {{ucfirst:{{number to word|{{{chapter|{{{3|}}}}}}}}}}
  }}<!--
 
1.2: Rest of the wikilink, i.e. the chapter title in the link target, plus the alias (chapter title).
-->: {{user:Harrystein/sandbox/template/MIA citation/4|{{{volume|{{{2|}}}}}}|{{{chapter|{{{3|}}}}}}}}|"{{user:Harrystein/sandbox/template/MIA citation/4|{{{volume|{{{2|}}}}}}|{{{chapter|{{{3|}}}}}}}}."]] <!--
 
1.3: Hyperlink
-->Link: [{{if then show|{{{link|}}}|https://www.marxists.org/archive/marx/works/{{trim|{{array|get|1867-c1,1885-c2,1894-c3|,|{{{volume|{{{2|}}}}}}}}}}/ch{{#switch: {{{volume|{{{2|}}}}}}{{{chapter|{{{3|}}}}}} | 220 | 221 = {{{chapter|{{{3|}}}}}}_01 | {{#ifexpr: {{{chapter|{{{3|}}}}}} > 9 | {{{chapter|{{{3|}}}}}} | 0{{{chapter|{{{3|}}}}}}}}}}.htm}} Available online]
 
<!--
Other works:
-->
| shoehorn = Shoehorn!<!--other works than capital would go here.-->
|
}}

Latest revision as of 21:21, 5 June 2024

Special case citer. Primarily intended for sub-template use by forthcoming MIA cite template, but also may come in handy when called directly.

1 = work e.g. capital
2 = volume e.g. 1
3 = chapter e.g. 3
4 = link e.g. https:// etc. etc.

This has now been implemented at Template:MIA citation/special

Marx, Karl & Engels, Friedrich (1867). Capital, Volume I. Chapter : [[Das Kapital, Volume I, Chapter Lua error in Module:ConvertNumeric at line 576: Invalid decimal numeral.: |"."]] Link: Expression error: Unexpected > operator..htm Available online