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
Built Distribution
File details
Details for the file mwcomposerfromhell-0.5.tar.gz
.
File metadata
- Download URL: mwcomposerfromhell-0.5.tar.gz
- Upload date:
- Size: 21.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c73c6935dca08af729c6405058611014642090a424826f14ea20f32683282b66 |
|
MD5 | 5f224fa4063bf077deb89d6e3b650409 |
|
BLAKE2b-256 | 8b108d93025e303b36dfacea9f88a9dc45232d039ce914dbe9580458eff01158 |
Provenance
File details
Details for the file mwcomposerfromhell-0.5-py3-none-any.whl
.
File metadata
- Download URL: mwcomposerfromhell-0.5-py3-none-any.whl
- Upload date:
- Size: 19.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ed4125b64d82ea725085250482867498665d8aa193f471fe70c76ac9f700a278 |
|
MD5 | 73bb109472275055923cd2f223223111 |
|
BLAKE2b-256 | bf0ebe4d4072bb774b8b980e23f152eb12bd84c2f5accd7ac747be2455bdd282 |