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

From Leftypedia
Jump to navigation Jump to search
m (Undo revision 22532 by Harrystein (talk))
Tag: Undo
mNo edit summary
 
(16 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{#tag:ref|<!--
<noinclude>implemented at [[template:MIA citation]]</noinclude>{{#tag:ref|<!--
#0: Check for special cases. Hacky solution that probably could be streamlined or simplified
#0: Check for special cases using sub-template. This section currently (6/1/24) only works with capital vol 1.
-->{{if then show|{{#switch:<!--
-->{{if then show|{{#switch:<!--
#0.1: The following returns codes that are then used by the switch function.
#0.1: The following returns codes that are then used by the switch function.
Line 6: Line 6:
   | capital = marx/works/18%d%d%-c%d
   | capital = marx/works/18%d%d%-c%d
   | _default = NO SPECIAL CASE
   | _default = NO SPECIAL CASE
  }}<!--
This converts the code from the above into a sub-template or direct formatting to output for each given special case.
-->
| capital =
  {{User:Harrystein/sandbox/template/MIA citation/5
  | work = capital
  | volume = {{switch by pattern|_input={{{link|{{{1|}}}}}}|_returncaptures=y|marx/works/18%d%d%-c([1-3])|_default=1}}
  | chapter = {{switch by pattern|_input={{{link|{{{1|}}}}}}|_returncaptures=y|marx/works/18%d%d%-c[1-3]/ch0?(%d%d?)}}
  | link = {{{link|{{{1|}}}}}}
   }}
   }}
| capital = TRIGGER. [[Karl Marx|Marx, Karl]] ({{trim|{{array|get|year one, year two, year three|,|{{switch by pattern|_input={{{link|{{{1|}}}}}}|_returncaptures=y|marx/works/1867%-c([1-3])|_default=1}}}}}}). ''[[Das Kapital, Volume fesr|Capital, Volume I]], Chapter {{switch by pattern|_input={{{link|{{{1|}}}}}}|_returncaptures=y|marx/works/1867%-c1/ch0?(%d%d?)}}: [[Das Kapital, Volume I, Chapter <!--
Very ugly way to make sure that e.g. Twenty-eight is capitalized as Twenty-Eight. Basically useless unless you are super autistic (like me).
-->{{#if:{{switch by pattern|_input={{{link|{{{1|}}}}}}|marx/works/1867%-c1/ch[^01]([1-9])}}
  | {{ucfirst:{{string split|{{number to word|{{switch by pattern|_input={{{link|{{{1|}}}}}}|_returncaptures=y|marx/works/1867%-c1/ch0?(%d%d?)}}}}|-}}}}-{{ucfirst:{{string split|{{number to word|{{switch by pattern|_input={{{link|{{{1|}}}}}}|_returncaptures=y|marx/works/1867%-c1/ch0?(%d%d?)}}}}|-|2}}}}
  | {{title case|{{number to word|{{switch by pattern|_input={{{link|{{{1|}}}}}}|_returncaptures=y|marx/works/1867%-c1/ch0?(%d%d?)}}}}}}
  }}<!--
Rest of the wikilink, i.e. the chapter title
-->: {{user:Harrystein/sandbox/template/MIA citation/4|1|{{switch by pattern|_input={{{link|{{{1|}}}}}}|_returncaptures=y|marx/works/1867%-c1/ch0?(%d%d?)}}}}|"{{user:Harrystein/sandbox/template/MIA citation/4|1|{{switch by pattern|_input={{{link|{{{1|}}}}}}|_returncaptures=y|marx/works/1867%-c1/ch0?(%d%d?)}}}}."]] [{{{link|{{{1|}}}}}} Available online]
| capital2 = [[Karl Marx|Marx, Karl]] (1867). [{{{link|{{{1|}}}}}} ''Capital, Volume II'', Chapter {{switch by pattern|_input={{{link|{{{1|}}}}}}|_returncaptures=y|marx/works/1867%-c2/ch0?(%d%d?)}}]
| capital3 = [[Karl Marx|Marx, Karl]] (1867). [{{{link|{{{1|}}}}}} ''Capital, Volume III'', Chapter {{switch by pattern|_input={{{link|{{{1|}}}}}}|_returncaptures=y|marx/works/1867%-c3/ch0?(%d%d?)}}]
  |
  |
}}|<!--
}}|<!--
End of special case section.
#1: Author name
#1: Author name
-->{{#switch: {{replace|{{replace|{{lc:{{{2|{{{author|{{first word|{{string split|{{{link|{{{1|}}}}}}|/archive/|2}}|sep=/}}<!--shitty hack because i'm not a conputer geinius-->}}} }}} }}|,|}}|.|}}
-->{{#switch: {{replace|{{replace|{{lc:{{{2|{{{author|{{first word|{{string split|{{{link|{{{1|}}}}}}|/archive/|2}}|sep=/}}<!--shitty hack because i'm not a conputer geinius-->}}} }}} }}|,|}}|.|}}
Line 57: Line 57:
-->{{#if:{{{title|{{{4|}}}}}}|<includeonly>''[[{{title case|{{{title|{{{4|}}}}}}}}]]''. </includeonly>|<includeonly>[[category:pages incorrectly using the MIA citation template]]</includeonly>}}<!--
-->{{#if:{{{title|{{{4|}}}}}}|<includeonly>''[[{{title case|{{{title|{{{4|}}}}}}}}]]''. </includeonly>|<includeonly>[[category:pages incorrectly using the MIA citation template]]</includeonly>}}<!--
#4: Hyperlink.
#4: Hyperlink.
--> [{{{1|{{{link|<includeonly>[[category:pages incorrectly using the MIA citation template]]</includeonly>}}}}}} Available online]
--> [{{{1|{{{link|<includeonly>[[category:pages incorrectly using the MIA citation template]]</includeonly>}}}}}} Available online]}} at the [[Marxists Internet Archive]]
}} at the [[Marxists Internet Archive]]
}}
}}

Latest revision as of 21:21, 5 June 2024

implemented at template:MIA citation[1]

  1. [Author missing] (). [ Available online] at the Marxists Internet Archive