wikitexthtml
wikitexthtml is a library that renders HTML from WikiText.
Dependencies
- Python3.8 or higher.
python-slugify(viasetup.py), for slugs in anchorsply(viasetup.py), to implement{{#ifexpr}}and{{#expr}}wikitextparser(viasetup.py), to make sense of wikitext
Installation
pip install wikitexthtml
Or for development work:
python3 -m venv .env
.env/bin/pip install -e .
Usage
Extend Page by implementing the missing functions as seen in prototype.py. This way you can customize where files are read from (from disk, from a database, etc) and how to sanitize titles and URLs. In the tests folder examples of this can be found.
Now you can instantiate this new class and call render() on it.
The result will be available in html. For example:
class WikiPage(Page):
...
print(WikiPage("Main Page").render().html)
Release files for wikitexthtml 1.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| wikitexthtml-1.2.0.tar.gz | 27.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| wikitexthtml-1.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 65.1 kB
Release files / wikitexthtml-1.2.0.tar.gz
| Download URL | wikitexthtml-1.2.0.tar.gz |
|---|---|
| Size | 27.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
45922fcf61642dfb66a62f5f86ce536425be6841cabc6261e7870cf3ffd5e854
|
|
BLAKE2b-256 checksum How to use checksums |
c0da2936fc340c89c762550636e78beaed1845acfd636286e5bcce84df509075
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.8.16
|
Release files / wikitexthtml-1.2.0-py3-none-any.whl
| Download URL | wikitexthtml-1.2.0-py3-none-any.whl |
|---|---|
| Size | 37.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4b856659ff0d7d2cf8e336edf9af5a9803f92231bafe6ed4d5fa77a763a21a4a
|
|
BLAKE2b-256 checksum How to use checksums |
e8ab100007c50c40271fadb61ef3043cb47f4d91c4b662d1ccb69ee1c84622ea
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.8.16
|