This module provides a wrapper around various text markup languages.
Available by default are Markdown, reStructuredText, Textile and AsciiDoc, 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
<main id="hello-world">
<h1 class="title" data-posmap="3">Hello, world!</h1>
<p data-posmap="5">This is an example <strong>reStructuredText</strong> document.</p>
</main>
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 -m sphinx docs build/sphinx/html
Metadata
Release files for Markups 4.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| markups-4.1.1.tar.gz | 23.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| markups-4.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 37.6 kB
Release files / markups-4.1.1.tar.gz
| Download URL | markups-4.1.1.tar.gz |
|---|---|
| Size | 23.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d0284b14fe046037cb0473f08d5c63556042c14c5ed65379e81982afeb55bc21
|
|
BLAKE2b-256 checksum How to use checksums |
23e0d919050e3450491da92931a197c34bef4c1c63f5b174690ec197e5bb9804
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 29, 2025.
Transparency logRelease files / markups-4.1.1-py3-none-any.whl
| Download URL | markups-4.1.1-py3-none-any.whl |
|---|---|
| Size | 14.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e52f3a4fd1a0dfd24e2ff71afd29134b0fc0534f393e9581f0881575ee0339ba
|
|
BLAKE2b-256 checksum How to use checksums |
de47061b7489db19ba48de5913c1896b525d6d00ed358e9b504a1a9af95a3485
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 29, 2025.
Transparency log