A wrapper around various text markups
Project description
This module provides a wrapper around various text markup languages.
Available by default are Markdown, reStructuredText and Textile, but you can easily add your own markups.
Usage example:
>>> import markups
>>> markup = markups.get_markup_for_file_name("myfile.rst")
>>> markup.name
'reStructuredText'
>>> markup.attributes[markups.common.SYNTAX_DOCUMENTATION]
'https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html'
>>> text = """
... Hello, world!
... =============
...
... This is an example **reStructuredText** document.
... """
>>> result = markup.convert(text)
>>> result.get_document_title()
'Hello, world!'
>>> print(result.get_document_body()) # doctest: +NORMALIZE_WHITESPACE
<div class="document" id="hello-world">
<h1 class="title">Hello, world!</h1>
<p>This is an example <strong>reStructuredText</strong> document.</p>
</div>
The release version can be downloaded from PyPI or installed using:
pip install Markups
The source code is hosted on GitHub.
The documentation is available online or can be generated from source by installing Sphinx and running:
python3 setup.py build_sphinx
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Markups-3.1.0.tar.gz
(20.1 kB
view details)
Built Distribution
Markups-3.1.0-py3-none-any.whl
(12.5 kB
view details)
File details
Details for the file Markups-3.1.0.tar.gz
.
File metadata
- Download URL: Markups-3.1.0.tar.gz
- Upload date:
- Size: 20.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.1+
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e152b33c4205abe1fb90e01cb82b717d2cb469d5db006e3829a7d68df1c7f78b |
|
MD5 | 0f0b1e34ebc987f1a50b776bd2965ecc |
|
BLAKE2b-256 | 204d9576cdfd16986951e9f7b46529b214d50e132ed506726b7ba1b24668ce0b |
File details
Details for the file Markups-3.1.0-py3-none-any.whl
.
File metadata
- Download URL: Markups-3.1.0-py3-none-any.whl
- Upload date:
- Size: 12.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.1+
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e48f28171a35a7024b60fea3fe0a4bf214d1fb294011a0c96ca88fa56310ceb5 |
|
MD5 | 6bacff68f5c315944ad6d0727900cb7b |
|
BLAKE2b-256 | 369a0f150d4c89fc3fe315a58f5d7439725d6c88cdc8867e30a3c19eb0af57f2 |