Skip to main content

wikitexthtml

GitHub License GitHub Tag GitHub commits since latest release

GitHub Workflow Status (Testing) GitHub Workflow Status (Release)

wikitexthtml is a library that renders HTML from WikiText.

Dependencies

  • Python3.8 or higher.
  • python-slugify (via setup.py), for slugs in anchors
  • ply (via setup.py), to implement {{#ifexpr}} and {{#expr}}
  • wikitextparser (via setup.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)

Source distribution for wikitexthtml 1.2.0
File Size Uploaded
wikitexthtml-1.2.0.tar.gz 27.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for wikitexthtml 1.2.0
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

1.2.0 This release

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.13

2 release files

0.0.12

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page