Skip to content
Convert parsed MediaWiki wikicode (using mwparserfromhell) to HTML.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
mwcomposerfromhell
tests
.flake8
.gitignore
.travis.yml
CHANGELOG.rst
LICENSE
MANIFEST.in
README.rst
requirements-dev.txt
requirements.txt
setup.py

README.rst

mwcomposerfromhell

https://travis-ci.org/clokep/mwcomposerfromhell.svg?branch=master

mwcomposerfromhell is a Python package that provides an easy-to-use method to convert MediaWiki Wikicode to HTML via mwparserfromhell. It supports Python 3.

Usage

Normal usage is rather straightforward to convert from a str of Wikicode to a str of HTML. It involves two steps:

  1. Parse the Wikicode to an abstract syntax tree using mwparserfromhell.
  2. Convert the AST to HTML.
>>> import mwparserfromhell
>>> import mwcomposerfromhell
>>> wikicode = mwparserfromhell.parse(text)  # Step 1
>>> html = mwcomposerfromhell.compose(wikicode)  # Step 2
You can’t perform that action at this time.