paveld/mw-markdown-wiki

An extension for markdown support in mediawiki pages

Installs: 28

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 2

Type:mediawiki-extension

v0.3.2 2022-01-24 23:33 UTC

This package is auto-updated.

Last update: 2024-04-25 04:09:00 UTC


README

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.