Template:MIA citation: Difference between revisions

From Leftypedia
Jump to navigation Jump to search
(Implementing from [:User:Harrystein/sandbox/template/MIA citation]])
 
mNo edit summary
Line 2: Line 2:
{{lspp}}
{{lspp}}
[[category:MIA citation template]]
[[category:MIA citation template]]
Description here!
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>|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>{{#tag:ref|<!--
[[category:original templates]]</noinclude>{{#tag:ref|<!--
#0: Check for special cases using sub-template. This section currently (6/1/24) only works with capital vol 1.
#0: Check for special cases using sub-template. This section currently (6/1/24) only works with capital vol 1.
Line 25: Line 62:
End of special case section.
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:{{{author|{{{2|{{first word|{{string split|{{{link|{{{1|}}}}}}|/archive/|2}}|sep=/}}<!--shitty hack because i'm not a conputer geinius-->}}} }}} }}|,|}}|.|}}
  | stalin
  | stalin
  | j v stalin
  | j v stalin

Revision as of 21:57, 5 June 2024

In this templatespace:

Template talk:

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>|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}}

Sample[1]

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