Skip to main content

Convert the parsed MediaWiki wikicode (using mwparserfromhell) to HTML.

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

mwcomposerfromhell-0.3-py3-none-any.whl (13.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page