Convert the parsed MediaWiki wikicode (using mwparserfromhell) to HTML.
Project description
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:
Parse the Wikicode to an abstract syntax tree using mwparserfromhell.
Convert the AST to HTML.
>>> import mwparserfromhell
>>> import mwcomposerfromhell
>>> wikicode = mwparserfromhell.parse(text) # Step 1
>>> html = mwcomposerfromhell.compose(wikicode) # Step 2
You can also use it from the command line if you already have your wikicode in a file. The convert HTML is output on standard out.
python -m mwcomposerfromhell path/to/my/wikicode
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
mwcomposerfromhell-0.5.tar.gz
(21.3 kB
view hashes)
Built Distribution
Close
Hashes for mwcomposerfromhell-0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ed4125b64d82ea725085250482867498665d8aa193f471fe70c76ac9f700a278 |
|
MD5 | 73bb109472275055923cd2f223223111 |
|
BLAKE2b-256 | bf0ebe4d4072bb774b8b980e23f152eb12bd84c2f5accd7ac747be2455bdd282 |