Extension:MarkdownExtraParser

From MediaWiki.org
Jump to: navigation, search
MediaWiki extensions manual
Crystal Clear action run.png
MarkdownExtraParser

Release status: beta

Implementation Parser function
Description A quick MediaWiki hook for using a Markdown parser
Author(s) Trevor N. Suarez (Rican7talk)
MediaWiki 1.20+
PHP >= 5.3
Database changes No
License MIT
Download
README
Parameters

$MarkdownExtraParserOptions

Hooks used
ParserBeforeStrip

InternalParseBeforeSanitize
InternalParseBeforeLinks

Translate the MarkdownExtraParser extension if possible

Check usage and version matrix; code metrics

The MarkdownExtraParser extension allows for hooking MediaWiki's parser to use Michael Fortin's PHP Markdown Extra library.

Download[edit | edit source]

Clone the GitHub repo or download the zip

Installation[edit | edit source]

  1. Create a folder in your "$IP/extensions" directory called "MarkdownExtraParser"
    Note: $IP is your MediaWiki install directory
    You should have something like this: $IP/extensions/MarkdownExtraParser/
  2. Clone the GitHub repo into your new directory (or download the zip)
  3. Download Michael Fortin's PHP Markdown Extra library
  4. Extract and copy the "markdown.php" file into your new "$IP/extensions/MarkdownExtraParser/" directory
  5. Enable the extension by adding the following line to your "LocalSettings.php" file:
    require_once( "$IP/extensions/MarkdownExtraParser/MarkdownExtraParser.php" );
    

Configuration[edit | edit source]

Before "requiring" the extension, you can set an array variable to hold some configuration settings for MarkdownExtraParser, like so:

// MarkdownExtraParser
$MarkdownExtraParserOptions = array(
    'use_raw_html' => true,
);
Available Options
  • 'use_raw_html' - Allows for more advanced markdown-to-HTML conversions, such as image tags, etc.

See also[edit | edit source]