Skip to main content

A wrapper around various text markups

Project description

Travis CI 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]
'http://docutils.sourceforge.net/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. 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.0.0.tar.gz (17.0 kB view details)

Uploaded Source

Built Distribution

Markups-3.0.0-py2.py3-none-any.whl (12.3 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: Markups-3.0.0.tar.gz
  • Upload date:
  • Size: 17.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for Markups-3.0.0.tar.gz
Algorithm Hash digest
SHA256 1ea19458dfca6a4562044e701aa8698089a0c659fc535689ed260f89a04f8d39
MD5 6a2192caf4d913c7a31419946a34538e
BLAKE2b-256 2f355eda745b115048ddd7ae7e66ba49862ec9d6fd12b3cd4ff0810b9a213c10

See more details on using hashes here.

File details

Details for the file Markups-3.0.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for Markups-3.0.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 dd00c7f082d375bb63d6eb6873b1f984c9b474829a3ff1f9518202c64538d539
MD5 551f4abbf587e8af0d326219d8ec50b1
BLAKE2b-256 56c0d77c6af4f43c00268372fcbaee715dc798ce70c6c6a93ae30bec32af94ed

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