Pymarkups
Wrapper around various text markups, used in ReText
Install / Use
/learn @retext-project/PymarkupsREADME
.. image:: https://github.com/retext-project/pymarkups/workflows/tests/badge.svg :target: https://github.com/retext-project/pymarkups/actions :alt: GitHub Actions status .. image:: https://codecov.io/gh/retext-project/pymarkups/branch/master/graph/badge.svg :target: https://codecov.io/gh/retext-project/pymarkups :alt: Coverage status .. image:: https://readthedocs.org/projects/pymarkups/badge/?version=latest :target: https://pymarkups.readthedocs.io/en/latest/ :alt: 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.
To install Markups from PyPI_, specify the list of markups you want to include, e.g.::
pip install Markups[markdown,restructuredtext]
Usage example:
.. code:: python
<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>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
.. _Markdown: https://daringfireball.net/projects/markdown/ .. _reStructuredText: https://docutils.sourceforge.io/rst.html .. Textile: https://en.wikipedia.org/wiki/Textile(markup_language) .. _AsciiDoc: https://asciidoc.org .. _PyPI: https://pypi.org/project/Markups/
The source code is hosted on GitHub_.
.. _GitHub: https://github.com/retext-project/pymarkups
The documentation is available online_ or can be generated from source by installing Sphinx_ and running::
python3 -m sphinx docs build/sphinx/html
.. _online: https://pymarkups.readthedocs.io/en/latest/ .. _Sphinx: https://www.sphinx-doc.org/en/master/
Related Skills
node-connect
343.1kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
90.0kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
343.1kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
343.1kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
