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

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

Uploaded Source

Built Distribution

markups-4.1.1-py3-none-any.whl (14.6 kB view details)

Uploaded Python 3

File details

Details for the file markups-4.1.1.tar.gz.

File metadata

  • Download URL: markups-4.1.1.tar.gz
  • Upload date:
  • Size: 23.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for markups-4.1.1.tar.gz
Algorithm Hash digest
SHA256 d0284b14fe046037cb0473f08d5c63556042c14c5ed65379e81982afeb55bc21
MD5 9bc1d498ba110b7535ac141c9be0009b
BLAKE2b-256 23e0d919050e3450491da92931a197c34bef4c1c63f5b174690ec197e5bb9804

See more details on using hashes here.

Provenance

The following attestation bundles were made for markups-4.1.1.tar.gz:

Publisher: main.yml on retext-project/pymarkups

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file markups-4.1.1-py3-none-any.whl.

File metadata

  • Download URL: markups-4.1.1-py3-none-any.whl
  • Upload date:
  • Size: 14.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for markups-4.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e52f3a4fd1a0dfd24e2ff71afd29134b0fc0534f393e9581f0881575ee0339ba
MD5 1c607d7430e8fc7c3ec53de38f3cb2bf
BLAKE2b-256 de47061b7489db19ba48de5913c1896b525d6d00ed358e9b504a1a9af95a3485

See more details on using hashes here.

Provenance

The following attestation bundles were made for markups-4.1.1-py3-none-any.whl:

Publisher: main.yml on retext-project/pymarkups

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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