python-lsp / docstring-to-markdown

On the fly conversion of Python docstrings to markdown
GNU Lesser General Public License v2.1
22 stars 8 forks source link

docstring-to-markdown

tests CodeQL pypi-version

On the fly conversion of Python docstrings to markdown

Installation

pip install docstring-to-markdown

Example

Convert reStructuredText:

>>> import docstring_to_markdown
>>> docstring_to_markdown.convert(':math:`\\sum`')
'$\\sum$'

When given the format cannot be recognised an exception will be raised:

>>> docstring_to_markdown.convert('\\sum')
Traceback (most recent call last):
    raise UnknownFormatError()
docstring_to_markdown.UnknownFormatError

Development

pip install -e .
pytest