This extension allows MediaWiki users to write arguments in Argdown. It will automatically generate argument maps using Argdown's official engine for Node.js. Since Argdown is text-based (like Markdown or Wikitext), you can use MediaWiki's version-tracking functionality to see how arguments evolve over time and get an argument map for each version.
- Install Node.js, version 13 or higher. As of this writing,
apt
doesn't have that version yet; I recommend following options 2 or 3 from this guide. - Download the extension and unzip it into the folder
mediawiki/extensions/Argdown
cd
to themediawiki/extensions/Argdown
folder and runnpm install
to install the Argdown engine- Run
which node
and put the result inmediawiki/extensions/Argdown/extension.json
, underconfig/NodeJsPath/value
. (The extension needs to know the path to your Node.js executable and may not be able to get it from your $PATH.) - In
mediawiki/LocalSettings.php
, add this line:wfLoadExtension( 'Argdown' );
- If you'd like a toolbar button for Argdown, add this line too:
wfLoadExtension( 'WikiEditor' );
- Navigate to Special:Version on your wiki to verify that the extension is installed.
- Try it out! Copy this block of code into a wiki page and click "Show preview" to see if you get an argument map:
<argdown>
[statement]: I am a statement. #tag1
- <argument 1>
+ <argument 2>
<_ <argument 3>
</argdown>
If nothing appears when you test the extension, most likely the extension needs more memory. By default, PHP allocates 30 MiB of memory to shell commands, which isn't enough to run Node.js.
To check whether this is the problem, try putting this line in mediawiki/LocalSettings.php
: $wgMaxShellMemory = 0;
This will disable the memory limitation. You probably don't want to do that long-term, so if setting $wgMaxShellMemory
to 0 allows Argdown to appear, try setting it to 20000000 and increase it from there until it works.
If $wgMaxShellMemory = 0;
doesn't work, please open a GitHub issue and perhaps I can help you find a solution.
When editing any wiki page, wrap your argument in <argdown>
</argdown>
tags and they'll be formatted in Argdown.
If you're using WikiEditor, click this button in the toolbar to insert the Argdown tags:
Once you save the page, you'll see an automatically-generated map of your argument, like so:
You can click the "Source" button in the corner to see the your argument in written form:
For more information on composing arguments in Argdown, please see the official guide and syntax reference.
- Vector (MediaWiki default skin)
- Timeless
- Tweeki
Other skins may also work, but sometimes the behavior of the "maximize" button needs to be adjusted for each skin.
If you have more than one argument map on your page, you will see the error Uncaught DOMException: CustomElementRegistry.define: 'argdown-map' has already been defined as a custom element
in your browser's console. This should not affect functionality.
To enable logging, add this to your LocalSettings.php
:
$wgDebugLogGroups = array(
'argdown' => 'extensions/Argdown/argdown.log'
);
This will create an argdown.log
file in the extension folder.
Last tested with MediaWiki 1.35.1 and Argdown 1.5.