Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | 03-May-2022 | - | ||||
Markups.egg-info/ | H | 03-May-2022 | - | 92 | 76 | |
docs/ | H | 21-Nov-2021 | - | 361 | 237 | |
markups/ | H | 21-Nov-2021 | - | 658 | 518 | |
tests/ | H | 21-Nov-2021 | - | 519 | 426 | |
LICENSE | H A D | 06-Sep-2021 | 1.5 KiB | 28 | 24 | |
MANIFEST.in | H A D | 06-Sep-2021 | 142 | 7 | 6 | |
PKG-INFO | H A D | 21-Nov-2021 | 3.7 KiB | 92 | 76 | |
README.rst | H A D | 21-Nov-2021 | 2.1 KiB | 62 | 47 | |
changelog | H A D | 21-Nov-2021 | 5.9 KiB | 204 | 143 | |
markup2html.py | H A D | 06-Sep-2021 | 1.2 KiB | 36 | 27 | |
pyproject.toml | H A D | 06-Sep-2021 | 56 | 3 | 2 | |
setup.cfg | H A D | 21-Nov-2021 | 1.4 KiB | 51 | 45 | |
setup.py | H A D | 06-Sep-2021 | 62 | 6 | 2 |
README.rst
1.. image:: https://github.com/retext-project/pymarkups/workflows/tests/badge.svg 2 :target: https://github.com/retext-project/pymarkups/actions 3 :alt: GitHub Actions status 4.. image:: https://codecov.io/gh/retext-project/pymarkups/branch/master/graph/badge.svg 5 :target: https://codecov.io/gh/retext-project/pymarkups 6 :alt: Coverage status 7.. image:: https://readthedocs.org/projects/pymarkups/badge/?version=latest 8 :target: https://pymarkups.readthedocs.io/en/latest/ 9 :alt: ReadTheDocs status 10 11This module provides a wrapper around various text markup languages. 12 13Available by default are Markdown_, reStructuredText_ and Textile_, but you 14can easily add your own markups. 15 16Usage example: 17 18.. code:: python 19 20 >>> import markups 21 >>> markup = markups.get_markup_for_file_name("myfile.rst") 22 >>> markup.name 23 'reStructuredText' 24 >>> markup.attributes[markups.common.SYNTAX_DOCUMENTATION] 25 'https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html' 26 >>> text = """ 27 ... Hello, world! 28 ... ============= 29 ... 30 ... This is an example **reStructuredText** document. 31 ... """ 32 >>> result = markup.convert(text) 33 >>> result.get_document_title() 34 'Hello, world!' 35 >>> print(result.get_document_body()) # doctest: +NORMALIZE_WHITESPACE 36 <main id="hello-world"> 37 <h1 class="title" data-posmap="3">Hello, world!</h1> 38 <p data-posmap="5">This is an example <strong>reStructuredText</strong> document.</p> 39 </main> 40 41.. _Markdown: https://daringfireball.net/projects/markdown/ 42.. _reStructuredText: https://docutils.sourceforge.io/rst.html 43.. _Textile: https://en.wikipedia.org/wiki/Textile_(markup_language) 44 45The release version can be downloaded from PyPI_ or installed using:: 46 47 pip install Markups 48 49.. _PyPI: https://pypi.org/project/Markups/ 50 51The source code is hosted on GitHub_. 52 53.. _GitHub: https://github.com/retext-project/pymarkups 54 55The documentation is available online_ or can be generated from source by 56installing Sphinx_ and running:: 57 58 python3 setup.py build_sphinx 59 60.. _online: https://pymarkups.readthedocs.io/en/latest/ 61.. _Sphinx: https://www.sphinx-doc.org/en/master/ 62