Skip to main content

A wrapper around various text markups

Project description

GitHub Actions status Coverage status ReadTheDocs status

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
<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 setup.py build_sphinx

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

Markups-3.1.3.tar.gz (20.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

Markups-3.1.3-py3-none-any.whl (12.8 kB view details)

Uploaded Python 3

File details

Details for the file Markups-3.1.3.tar.gz.

File metadata

  • Download URL: Markups-3.1.3.tar.gz
  • Upload date:
  • Size: 20.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0+

File hashes

Hashes for Markups-3.1.3.tar.gz
Algorithm Hash digest
SHA256 ab9747a72c1c6457418eb4276c79871977c13a654618e4f12e2a1f0990fbf2fc
MD5 2cd774e7dee4eb54c2bd7a2d04370c7d
BLAKE2b-256 982a79a3a4d67ee4c5a591ea6fe91d2ae18a9d30613cb2359dc01dc214372574

See more details on using hashes here.

File details

Details for the file Markups-3.1.3-py3-none-any.whl.

File metadata

  • Download URL: Markups-3.1.3-py3-none-any.whl
  • Upload date:
  • Size: 12.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0+

File hashes

Hashes for Markups-3.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 995a299c3e8242b030d519acfb35cc8fb19e6d8b5112f6d9d2a6ece4d3efccc1
MD5 8c870f2cc6c3f1a164fd82aa18f6ccb7
BLAKE2b-256 6573d6f53620067a17edd116d4969685c95bd2814f7bd52420f39d61a36f808f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page