• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

Markups.egg-info/H03-May-2022-9276

docs/H21-Nov-2021-361237

markups/H21-Nov-2021-658518

tests/H21-Nov-2021-519426

LICENSEH A D06-Sep-20211.5 KiB2824

MANIFEST.inH A D06-Sep-2021142 76

PKG-INFOH A D21-Nov-20213.7 KiB9276

README.rstH A D21-Nov-20212.1 KiB6247

changelogH A D21-Nov-20215.9 KiB204143

markup2html.pyH A D06-Sep-20211.2 KiB3627

pyproject.tomlH A D06-Sep-202156 32

setup.cfgH A D21-Nov-20211.4 KiB5145

setup.pyH A D06-Sep-202162 62

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