Template:MIA citation/special: Difference between revisions

From Leftypedia
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 19: Line 19:
-->| 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 {{tarray|get|I,II,III|,|{{{volume|{{{2|}}}}}}}}|Capital, Volume {{trim|{{array|get|I,II,III|,|{{{volume|{{{2|}}}}}}}}}}.]]'' Chapter {{{chapter|{{{3|}}}}}}: [[Das Kapital, Volume {{tarray|get|I,II,III|,|{{{volume|{{{2|}}}}}}}}, Chapter <!--
-->| 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 {{tarray|get|I,II,III|,|{{{volume|{{{2|}}}}}}}}|Capital, Volume {{trim|{{array|get|I,II,III|,|{{{volume|{{{2|}}}}}}}}}}.]]'' Chapter {{{chapter|{{{3|}}}}}}: [[Das Kapital, Volume {{tarray|get|I,II,III|,|{{{volume|{{{2|}}}}}}}}, Chapter <!--


1.1: Next: Capitalize numerals, e.g. Twenty-eight to Twenty-Eight.
1.1: Next: Capitalize numerals, e.g. Twenty-eight into Twenty-Eight.
-->{{#if: {{switch by pattern|_input={{{chapter|{{{3|}}}}}}|true=[^1][1-9]|_default=}}
-->{{#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:{{string split|{{number to word|{{{chapter|{{{3|}}}}}}}}|-}}}}-{{ucfirst:{{string split|{{number to word|{{{chapter|{{{3|}}}}}}}}|-|2}}}}
Line 28: Line 28:
-->: {{MIA citation/special/capital|{{{volume|{{{2|}}}}}}|{{{chapter|{{{3|}}}}}}}}|"{{MIA citation/special/capital|{{{volume|{{{2|}}}}}}|{{{chapter|{{{3|}}}}}}}}."]] <!--
-->: {{MIA citation/special/capital|{{{volume|{{{2|}}}}}}|{{{chapter|{{{3|}}}}}}}}|"{{MIA citation/special/capital|{{{volume|{{{2|}}}}}}|{{{chapter|{{{3|}}}}}}}}."]] <!--


1.3: Hyperlink. Essentially builds a hyperlink if none is found
1.3: Hyperlink. Essentially builds a hyperlink if none is found. Special cases accounted for are Volume II chs. 20 & 21.
-->[{{if then show|{{{link|{{{4|}}}}}}|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]
-->[{{if then show|{{{link|{{{4|}}}}}}|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]



Revision as of 23:36, 8 June 2024

In this templatespace:

Template talk:

Special case citer. Primarily intended for sub-template use by forthcoming MIA cite template, but will definitely come in handy for being called directly, e.g.:

{{MIA citation/special|capital|3|13}}

Producing:

In this way, one can cite a given MIA text without having to grab the link, providing an option that some may find to be a time-saver. However, i have no idea whether creating several sub-templates is a resource issue versus putting them under the regular MIA citation template as "special cases"; as such, i will leave SUS and Manifesto there for now even though they would be immensely handy, and editing them like this - without having to deal with endless sub-curly-brackets and functions and whatnot - would be probably easier. -Harry 6/6/24

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

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.: |"."]] Expression error: Unexpected > operator..htm Available online