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
<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


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.1.tar.gz (20.5 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: Markups-3.1.1.tar.gz
  • Upload date:
  • Size: 20.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/54.1.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.9.1+

File hashes

Hashes for Markups-3.1.1.tar.gz
Algorithm Hash digest
SHA256 e309d79dde0935576ce1def6752f2127a12e2c2ea2ae8b0c69f99ff8bc12181d
MD5 fcf5d536e3d64ecb56510fd65ad4940f
BLAKE2b-256 7f68a62560d80036e79792607d23bb4b9a28bfbaf906b3155c40f7d0ad5cc480

See more details on using hashes here.

File details

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

File metadata

  • Download URL: Markups-3.1.1-py3-none-any.whl
  • Upload date:
  • Size: 12.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/54.1.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.9.1+

File hashes

Hashes for Markups-3.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ab6e8516051cdcd953d25e8d7b753ba63d03a55d23fe4b01f93a62ab4769baae
MD5 408df9f975a00245ea84579aa402c467
BLAKE2b-256 277228b1d8ac27cbf30322ad17d825f793f355dedefbbddfbbe62ca44ad53039

See more details on using hashes here.

Supported by

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