Skip to content

PavelD/mw-markdown-wiki

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MarkdownWiki extension for MediaWiki

About

This extension allows usage of Markdown syntax on wiki pages. It's based on extension of the Cebe's Markdown library for parsing Mrkdown into WikiText syntax.

Why new extension

I have many markdown files that used to be source for our personal web in the past. But the provider is gone and I had many files on my disk with some not well known dialect of Markdown inside.

There is Blake's Markdown. It's not working ion the version of MediaWiki I have and fixing it turns into this project. To be more flexible in parsing I swhitched backend library to Cebe's Markdown parser. As well I inject some wiki syntax into the files and change the logic of the parsing.

Now it's possilbe to combine the Markkdown language with wiki syntax.

To simplify the extension I extracted MarkdownWiki parser to separated project.

Instalation

  • In $mw run COMPOSER=composer.local.json composer require --no-update paveld/mw-markdown-wiki, where $mw is a path to your MediaWiki installation
  • In $mw run composer update paveld/mw-markdown-wiki --no-dev -o
  • Add the following to $mw/LocalSettings.php:
wfLoadExtension( 'MarkdownWiki' );

Set MarkdwonWiki as default paser add to the file as well following code:

$wgMarkdownWikiDefaultOn = true;

Usage

To alow markdown syntax in the article put {{MARKDOWN}} tp the begging of the page.

To use Markdown on every page use $wgMarkdownWikiDefaultOn in $mw/LocalSettings.php

Custom markdown elements

See README.md on the MarkdownWiki project page.