Extension:MarkdownSyntax

MarkdownSyntax is a MediaWiki extension that enables markdown syntax. Markdown is a text-to-HTML conversion tool for web writers. Markdown allows you to write using an easy-to-read, easy-to-write plain text format, then convert it to structurally valid XHTML (or HTML).

Installation

 * 1) Create a folder in your $IP/extensions directory called MarkdownSyntax.
 * Note: $IP is your MediaWiki install dir.
 * You have something like this: $IP/extensions/MarkdownSyntax/
 * 1) Download Michel Fortin's PHP Markdown, unzip and look for the file markdown.php.
 * Note: Don't download PHP Markdown Extra. Only PHP Markdown is supported. PHP Markdown Extra may be supported in a future release
 * 1) Drop markdown.php into $IP/extensions/MarkdownSyntax/
 * 2) Copy the MarkdownSyntax.php source below and save it as MarkdownSyntax.php. Drop it into $IP/extensions/MarkdownSyntax/</tt> also.
 * 3) Enable the extension by adding this line to your LocalSettings.php</tt>: require_once( "$IP/extensions/MarkdownSyntax/MarkdownSyntax.php" );

Developer notes

 * Thanks to Ian Smith for his suggestion to use UsenetSyntax as a model for this extension. Thanks to Jim R. Wilson (Jimbojw) for writing UsenetSyntax.
 * Thanks to Thomas Peri (via New Orleans 2600) for tons of help with v0.2, especially writing the parsing URLs and converting them to MediaWiki URLs.

Limitations

 * 1) Markdown links: Title links are not supported because MediaWiki links don't support them.
 * i.e. [an example](http://example.com/ "Title") becomes <a href="http://example.com/">an example</a>, not <a href="http://example.com/" title="Title">an example</a>.

Bugs

 * 1) Markdown's code blocks and spans are a little buggy
 * 2) The edit links to the right of each heading aren't working for some reason.  They return a page like this: No such section: You tried to edit a section that doesn't exist. Since there is no section 3, there's no place to save your edit.
 * 3) Wikilinks to a title on the same page work, but they render the # symbol at the beginning of the link.
 * 4) Help:Magic words (like __NOTOC ) are rendered as bold text and their behaviour is disabled
 * 5) standard Wikitext is disabled totally (would it be possible to use the non-colliding ones?)
 * 6) some   around the title tag

More Testing Needed

 * Does anyone know how these Markdown tests (written in perl) could be executed somehow on a MediaWiki with this extension installed?

Todo List

 * Create a Mediawiki toolbar replacement with Markdown versions of the existing commands. Show how to add it.
 * Consider using Control.TextArea. It can format in Markdown syntax.
 * Try PHP Markdown Extra and see if it's features work.