Template:MIA citation: Difference between revisions

From Leftypedia
Jump to navigation Jump to search
(Re-formatted author section - this hopefully will make it easier to alphabetize in the future.)
(UNDO buggy title wikilink options for now until fix.)
 
(20 intermediate revisions by the same user not shown)
Line 1: Line 1:
<noinclude>
{{#tag:ref|<!--
{{lspp}}
[[category:MIA citation template]]
WIP template implemented by [[User:Harrystein|Harrystein]] to make citing [[Marxists.org]] a lot easier!
 
==Usage==
This is designed to read whatever Marxists.org URL you give it and output a nicely-formatted title, author, and year, complete with links to Leftypedia articles on those topics (aka "Wikilinks"). It doesn't use any LUA or outside coding/bots, which at the moment would be harder by an order of magnitude. If such things are implemented later, they should be used in concert with this template or, if they are pretty foolproof, supersede it.
 
===Visual editor===
In visual editing, you ''should'' be able to copy-paste the code shown below (adapted or otherwise) into your page. I would have to test this to see issues with it. If not, then [explain here how to make the link the only argument, even if not named, i.e. {{{1}}} ] -6/5/24
 
===Source editor===
This template is designed to do most of the work for you. I suggest starting by putting the link in, like so:
<nowiki>{{MIA citation|<link>}}</nowiki>
 
Any missing or incorrect details should be corrected:
 
<nowiki>{{MIA citation|<link>|author=<author>|author2=<author2> (optional)|year=<year>|title=<title>}}</nowiki>
 
See below for some examples.
 
''Capital'' works the best and hopefully should be fully implemented with no gaps:
 
<nowiki>{{MIA citation | https://www.marxists.org/archive/marx/works/1867-c1/ch03.htm#S1}}
{{MIA citation | https://www.marxists.org/archive/marx/works/1885-c2/ch20_02.htm}}
{{MIA citation | https://www.marxists.org/archive/marx/works/1894-c3/ch13.htm}}</nowiki>
 
* [[Karl Marx|Marx, Karl]] (1867). ''[[Das Kapital, Volume I|Capital, Volume I]]''. Chapter 3: [[Das Kapital, Volume I, Chapter Three: Money, or the Circulation of Commodities|"Money, or the Circulation of Commodities."]] [https://www.marxists.org/archive/marx/works/1867-c1/ch03.htm Available online] at the [[Marxists Internet Archive]]
 
* [[Karl Marx|Marx, Karl]] & [[Friedrich Engels|Engels, Friedrich]] (1885). ''[[Das Kapital, Volume II|Capital, Volume II]]''. Chapter 20: [[Das Kapital, Volume II, Chapter Twenty: Simple Reproduction|"Simple Reproduction."]] [https://www.marxists.org/archive/marx/works/1885-c2/ch20_02.htm Available online] at the [[Marxists Internet Archive]]
 
* [[Karl Marx|Marx, Karl]] & [[Friedrich Engels|Engels, Friedrich]] (1894). ''[[Das Kapital, Volume III|Capital, Volume III]]''. Chapter 13: [[Das Kapital, Volume III, Chapter Thirteen: The Law as Such|"The Law as Such."]] [https://www.marxists.org/archive/marx/works/1894-c3/ch13.htm Available online] at the [[Marxists Internet Archive]]
 
More Marx works will be added upon request or popular usage.
 
The template also works reasonably well with other works:
<nowiki>{{MIA citation | https://www.marxists.org/archive/draper/1990/zionism/13-antisemitism.htm}}
{{MIA citation | https://www.marxists.org/reference/archive/stalin/works/1938/09.htm | title = dialectical and Historical Materialism}}
{{MIA citation | https://www.marxists.org/archive/lenin/works/1917/staterev/ch01.htm | title = state and revolution}}
{{MIA citation | https://www.marxists.org/reference/archive/smith-adam/works/wealth-of-nations/book01/ch01.htm | title = the wealth of nations | year = 1776}}</nowiki>
 
Sample
[[category:original templates]]</noinclude><!--
 
===============================================================================================================================================================
 
TEMPLATE BEGINS HERE
-->{{#tag:ref|<!--


#0: Check for special cases using sub-template.
#0: Check for special cases using sub-template.
Line 82: Line 35:


#1: Author name. The "replace" functions are only here to normalize the input string by removing any periods or commas.
#1: Author name. The "replace" functions are only here to normalize the input string by removing any periods or commas.
-->{{#switch: {{replace|{{replace|{{lc:{{{author|{{{2|{{first word|{{string split|{{{link|{{{1|}}}}}}|/archive/|2}}|sep=/}}<!--shitty hack because i'm not a conputer geinius-->}}} }}} }}|,|}}|.|}}<!--
-->{{#switch: {{replace|{{replace|{{lc:{{if empty|{{{author|{{{2|}}}}}}|{{first word|{{string split|{{{link|{{{1|}}}}}}|/archive/|2}}|sep=/}}|default}}}}|,|}}|.|}}<!--


Marx Engels Lenin Stalin Mao-->
Marx Engels Lenin Stalin Mao-->
Line 94: Line 47:
  | trotsky | trotsky leon | leon trotsky | lev trotsky | trotsky lev | lev bronstein | bronstein lev = [[Leon Trotsky|Trotsky, Leon]]<!--
  | trotsky | trotsky leon | leon trotsky | lev trotsky | trotsky lev | lev bronstein | bronstein lev = [[Leon Trotsky|Trotsky, Leon]]<!--


Other authors, alphabetically sorted. -->
Other authors, alphabetically sorted; may have errors as some alphabetizing may be by hand. -->
| adam smith | smith-adam | smith adam = [[Adam Smith|Smith, Adam]]
| adorno = [[Theodor Adorno|Adorno, Theodor]]
  | alia = [[Ramiz Alia|Alia, Ramiz]]
  | alia = [[Ramiz Alia|Alia, Ramiz]]
| althusser = [[Louis Althusser|Althusser, Louis]]
  | andropov = [[Yuri Andropov|Andropov, Yuri]]
  | andropov = [[Yuri Andropov|Andropov, Yuri]]
  | bax = [[Ernest Belfort Bax|Bax, Ernest Belfort]]
  | bax = [[Ernest Belfort Bax|Bax, Ernest Belfort]]
Line 107: Line 63:
  | browder = [[Earl Browder|Browder, Earl]]
  | browder = [[Earl Browder|Browder, Earl]]
  | bukharin | bhukarin | nikolai bukharin | nikolai bhukarin = [[Nikolai Bukharin|Bukharin, Nikolai]]
  | bukharin | bhukarin | nikolai bukharin | nikolai bhukarin = [[Nikolai Bukharin|Bukharin, Nikolai]]
| cafiero = [[Carlo Cafiero|Cafiero, Carlo]]
  | chernenko = [[Konstantin Chernenko|Chernenko, Konstantin]]
  | chernenko = [[Konstantin Chernenko|Chernenko, Konstantin]]
  | connolly = [[James Connolly|Connolly, James]]
  | connolly = [[James Connolly|Connolly, James]]
Line 115: Line 72:
  | eastman = [[Max Eastman|Eastman, Max]]
  | eastman = [[Max Eastman|Eastman, Max]]
  | foster = [[William Z. Foster|Foster, William Z.]]
  | foster = [[William Z. Foster|Foster, William Z.]]
| goldman = [[Emma Goldman|Goldman, Emma]]
  | gorbachev = [[Mikhail Gorbachev|Gorbachev, Mikhail]]
  | gorbachev = [[Mikhail Gorbachev|Gorbachev, Mikhail]]
  | gorky-maxim | gorky = [[Maxim Gorky|Gorky, Maxim]]
  | gorky-maxim | gorky = [[Maxim Gorky|Gorky, Maxim]]
  | gramsci = [[Antonio Gramsci|Gramsci, Antonio]]
  | gramsci = [[Antonio Gramsci|Gramsci, Antonio]]
  | hall = [[Gus Hall|Hall, Gus]]
  | hall = [[Gus Hall|Hall, Gus]]
| hegel | g w f hegel | hegel g w f | hegel georg wilhelm friedrich | georg wilhelm friedrich hegel = [[Georg Wilhelm Friedrich Hegel|Hegel, G. W. F.]]
  | hill-christopher | christopher hill = [[Christopher Hill|Hill, Christopher]]
  | hill-christopher | christopher hill = [[Christopher Hill|Hill, Christopher]]
  | hillquit = [[Morris Hillquit|Hillquit, Morris]]
  | hillquit = [[Morris Hillquit|Hillquit, Morris]]
| horkheimer = [[Max Horkheimer|Horkheimer, Max]]
  | hoxha = [[Enver Hoxha|Hoxha, Enver]]
  | hoxha = [[Enver Hoxha|Hoxha, Enver]]
  | jaures | jaurès = [[Jean Jaurès|Jaurès, Jean]]
  | jaures | jaurès = [[Jean Jaurès|Jaurès, Jean]]
Line 127: Line 87:
  | kautsky = [[Karl Kautsky|Kautsky, Karl]]
  | kautsky = [[Karl Kautsky|Kautsky, Karl]]
  | khrushchev | nikita khrushchev | kruschev | khruschev | nikita kruschev | nikita khruschev = [[Nikita Khrushchev|Khrushchev, Nikita]]
  | khrushchev | nikita khrushchev | kruschev | khruschev | nikita kruschev | nikita khruschev = [[Nikita Khrushchev|Khrushchev, Nikita]]
  | kim-il-sung | kim il sung = [[Kim Il Sung|Kim Il Sung]]
  | kim-il-sung | kim il sung = [[Kim Il Sung|Kim, Il Sung]]
  | kim-jong-il | kim jong il = [[Kim Jong Il|Kim Jong Il]]
  | kim-jong-il | kim jong il = [[Kim Jong Il|Kim, Jong Il]]
  | kollonta<!--URL version.-->
  | kollonta<!--URL version.-->
  | kollontai = [[Alexandra Kollontai|Kollontai, Alexandra]]
  | kollontai = [[Alexandra Kollontai|Kollontai, Alexandra]]
| kropotkin-peter = [[Peter Kropotkin|Kropotkin, Peter]]
  | kun-bela | bela kun = [[Bela Kun|Kun, Bela]]
  | kun-bela | bela kun = [[Bela Kun|Kun, Bela]]
  | lafargue = [[Paul Lafargue|Lafargue, Paul]]
  | lafargue = [[Paul Lafargue|Lafargue, Paul]]
| lukacs = [[Georg Lukács|Lukács, Georg]]
  | luxemburg | luxembourg | rosa luxemburg | rosa luxembourg = [[Rosa Luxemburg|Luxemburg, Rosa]]
  | luxemburg | luxembourg | rosa luxemburg | rosa luxembourg = [[Rosa Luxemburg|Luxemburg, Rosa]]
  | maclean = [[John MacLean|MacLean, John]]
  | maclean = [[John MacLean|MacLean, John]]
| malatesta = [[Errico Malatesta|Malatesta, Errico]]
  | malenkov = [[Georgy Malenkov|Malenkov, Georgy]]
  | malenkov = [[Georgy Malenkov|Malenkov, Georgy]]
  | mariateg<!--URL version.--> | mariategui | mariátegui = [[José Carlos Mariátegui|Mariátegui, José Carlos]]
| mandel = [[Ernest Mandel|Mandel, Ernest]]
| marcuse = [[Herbert Marcuse|Marcuse, Herbert]]
  | mariateg<!--URL version.-->
| mariategui | mariátegui = [[José Carlos Mariátegui|Mariátegui, José Carlos]]
  | markievicz = [[Constance Markievicz|Markievicz, Constance]]
  | markievicz = [[Constance Markievicz|Markievicz, Constance]]
| mill-john-stuart = [[John Stuart Mill|Mill, J. S.]]
  | molotov = [[V. M. Molotov|Molotov, V. M.]]
  | molotov = [[V. M. Molotov|Molotov, V. M.]]
  | montefiore = [[Dora Montefiore|Montefiore, Dora]]
  | montefiore = [[Dora Montefiore|Montefiore, Dora]]
  | morris = [[William Morris|Morris, William]]
  | morris = [[William Morris|Morris, William]]
| pannekoe = [[Anton Pannekoek|Pannekoek, Anton]]
  | plekhanov = [[Georgi Plekhanov|Plekhanov, Georgi]]
  | plekhanov = [[Georgi Plekhanov|Plekhanov, Georgi]]
  | radek = [[Karl Radek|Radek, Karl]]
  | radek = [[Karl Radek|Radek, Karl]]
  | reed | john reed = [[John Reed|Reed, John]]
  | reed | john reed = [[John Reed|Reed, John]]
  | riazanov = [[David Riazanov|Riazanov, David]]
  | riazanov = [[David Riazanov|Riazanov, David]]
| rocker-rudolf = [[Rudolf Rocker|Rocker, Rudolf]]
  | roy = [[Manabendra Nath Roy|Roy, Manabendra Nath]]
  | roy = [[Manabendra Nath Roy|Roy, Manabendra Nath]]
  | scudder = [[Vida Dutton Scudder|Scudder, Vida Dutton]]
  | scudder = [[Vida Dutton Scudder|Scudder, Vida Dutton]]
  | serge = [[Victor Serge|Serge, Victor]]
  | serge = [[Victor Serge|Serge, Victor]]
| shachtma = [[Max Shachtman|Shachtman, Max]]
  | shehu = [[Mehmet Shehu|Shehu, Mehmet]]
  | shehu = [[Mehmet Shehu|Shehu, Mehmet]]
  | adam smith | smith-adam | smith adam = [[Adam Smith|Smith, Adam]]
  | stirner = [[Max Stirner|Stirner, Max]]
  | tito | josip broz tito = [[Josip Broz Tito|Tito, Josip Broz]]
  | tito | josip broz tito = [[Josip Broz Tito|Tito, Josip Broz]]
  | zinoviev = [[Gregory Zinoviev|Zinoviev, Gregory]]
  | zinoviev = [[Gregory Zinoviev|Zinoviev, Gregory]]
 
| ERROR
 
  | {{{author|[Author missing]}}}
  | {{{author|[Author missing]}}}
  }}<!--
  }}<!--
Line 169: Line 138:


#3: Title with wikilink.
#3: Title with wikilink.
-->{{#if:{{{title|{{{4|}}}}}}|<includeonly>''[[{{#ifeq:{{{titlecase|}}}|false|{{{title|{{{4|}}}}}}|{{title case|{{{title|{{{4|}}}}}}}}}}]]''. </includeonly>|<includeonly>[[category:pages incorrectly using the MIA citation template]]</includeonly>}}<!--
-->{{#if:{{{title|{{{4|}}}}}}|<includeonly>''[[{{#switch:{{{titlecase|{{{title case|}}}}}}|false|no|off={{{title|{{{4|}}}}}}|{{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]}} at the [[Marxists Internet Archive]]<!--
--> [{{{1|{{{link|<includeonly>[[category:pages incorrectly using the MIA citation template]]</includeonly>}}}}}} Available online]}} at {{ifeq|true|{{switch by pattern|_input={{{link|{{{1|}}}}}}|true=marxists%.architexturez%.net|_default=false}}|an archived version of |}}the [[Marxists Internet Archive]]<!--


#5: Quotation cited (optional)
#5: Quotation cited (optional)
Line 190: Line 159:


End of the Ref-Tag.
End of the Ref-Tag.
-->}}
-->}}<!--
 
====================================================================================================================================================================================
END OF TEMPLATE
====================================================================================================================================================================================
 
--><noinclude>
{{lspp}}
[[category:MIA citation template]]
WIP template implemented by [[User:Harrystein|Harrystein]] to make citing [[Marxists.org]] a lot easier!
 
==Usage==
This is designed to read whatever Marxists.org URL you give it and output a nicely-formatted title, author, and year, complete with links to Leftypedia articles on those topics (aka "Wikilinks"). It doesn't use any LUA or outside coding/bots, which at the moment would be harder by an order of magnitude. If such things are implemented later, they should be used in concert with this template or, if they are pretty foolproof, supersede it.
 
===Visual editor===
In visual editing, you ''should'' be able to copy-paste the code shown below (adapted or otherwise) into your page. I would have to test this to see issues with it. If not, then [explain here how to make the link the only argument, even if not named, i.e. {{{1}}} ] -6/5/24
 
===Source editor===
This template is designed to do most of the work for you. I suggest starting by putting the link in, like so:
<nowiki>{{MIA citation|<link>}}</nowiki>
 
Any missing or incorrect details should be corrected:
 
<nowiki>{{MIA citation|<link>|author=<author>|author2=<author2> (optional)|year=<year>|title=<title>}}</nowiki>
 
See below for some examples.
 
''Capital'' works the best and hopefully should be fully implemented with no gaps:
 
<nowiki>{{MIA citation | https://www.marxists.org/archive/marx/works/1867-c1/ch03.htm#S1}}
{{MIA citation | https://www.marxists.org/archive/marx/works/1885-c2/ch20_02.htm}}
{{MIA citation | https://www.marxists.org/archive/marx/works/1894-c3/ch13.htm}}</nowiki>
 
* [[Karl Marx|Marx, Karl]] (1867). ''[[Das Kapital, Volume I|Capital, Volume I]]''. Chapter 3: [[Das Kapital, Volume I, Chapter Three: Money, or the Circulation of Commodities|"Money, or the Circulation of Commodities."]] [https://www.marxists.org/archive/marx/works/1867-c1/ch03.htm Available online] at the [[Marxists Internet Archive]]
 
* [[Karl Marx|Marx, Karl]] & [[Friedrich Engels|Engels, Friedrich]] (1885). ''[[Das Kapital, Volume II|Capital, Volume II]]''. Chapter 20: [[Das Kapital, Volume II, Chapter Twenty: Simple Reproduction|"Simple Reproduction."]] [https://www.marxists.org/archive/marx/works/1885-c2/ch20_02.htm Available online] at the [[Marxists Internet Archive]]
 
* [[Karl Marx|Marx, Karl]] & [[Friedrich Engels|Engels, Friedrich]] (1894). ''[[Das Kapital, Volume III|Capital, Volume III]]''. Chapter 13: [[Das Kapital, Volume III, Chapter Thirteen: The Law as Such|"The Law as Such."]] [https://www.marxists.org/archive/marx/works/1894-c3/ch13.htm Available online] at the [[Marxists Internet Archive]]
 
More Marx works will be added upon request or popular usage.
 
The template also works reasonably well with other works:
<nowiki>{{MIA citation | https://www.marxists.org/archive/draper/1990/zionism/13-antisemitism.htm}}
{{MIA citation | https://www.marxists.org/reference/archive/stalin/works/1938/09.htm | title = dialectical and Historical Materialism}}
{{MIA citation | https://www.marxists.org/archive/lenin/works/1917/staterev/ch01.htm | title = state and revolution}}
{{MIA citation | https://www.marxists.org/reference/archive/smith-adam/works/wealth-of-nations/book01/ch01.htm | title = the wealth of nations | year = 1776}}</nowiki>
 
[[category:original templates]]</noinclude>

Latest revision as of 20:13, 20 June 2024

[1]

In this templatespace:

Template talk:

WIP template implemented by Harrystein to make citing Marxists.org a lot easier!

Usage

This is designed to read whatever Marxists.org URL you give it and output a nicely-formatted title, author, and year, complete with links to Leftypedia articles on those topics (aka "Wikilinks"). It doesn't use any LUA or outside coding/bots, which at the moment would be harder by an order of magnitude. If such things are implemented later, they should be used in concert with this template or, if they are pretty foolproof, supersede it.

Visual editor

In visual editing, you should be able to copy-paste the code shown below (adapted or otherwise) into your page. I would have to test this to see issues with it. If not, then [explain here how to make the link the only argument, even if not named, i.e. {{{1}}} ] -6/5/24

Source editor

This template is designed to do most of the work for you. I suggest starting by putting the link in, like so:

{{MIA citation|<link>}}

Any missing or incorrect details should be corrected:

{{MIA citation|<link>|author=<author>|author2=<author2> (optional)|year=<year>|title=<title>}}

See below for some examples.

Capital works the best and hopefully should be fully implemented with no gaps:

{{MIA citation | https://www.marxists.org/archive/marx/works/1867-c1/ch03.htm#S1}}
{{MIA citation | https://www.marxists.org/archive/marx/works/1885-c2/ch20_02.htm}}
{{MIA citation | https://www.marxists.org/archive/marx/works/1894-c3/ch13.htm}}

More Marx works will be added upon request or popular usage.

The template also works reasonably well with other works:

{{MIA citation | https://www.marxists.org/archive/draper/1990/zionism/13-antisemitism.htm}}
{{MIA citation | https://www.marxists.org/reference/archive/stalin/works/1938/09.htm | title = dialectical and Historical Materialism}}
{{MIA citation | https://www.marxists.org/archive/lenin/works/1917/staterev/ch01.htm | title = state and revolution}}
{{MIA citation | https://www.marxists.org/reference/archive/smith-adam/works/wealth-of-nations/book01/ch01.htm | title = the wealth of nations | year = 1776}}
  1. [Author missing] (). [ Available online] at the Marxists Internet Archive