Skip to main content

On the fly conversion of Python docstrings to markdown

Project description

docstring-to-markdown

tests CodeQL pypi-version

On the fly conversion of Python docstrings to markdown

  • Python 3.6+
  • can recognise reStructuredText and convert multiple of its features to Markdown
  • since v0.13 includes initial support for Google-formatted docstrings

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

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

docstring-to-markdown-0.13.tar.gz (26.6 kB view details)

Uploaded Source

Built Distribution

docstring_to_markdown-0.13-py3-none-any.whl (19.8 kB view details)

Uploaded Python 3

File details

Details for the file docstring-to-markdown-0.13.tar.gz.

File metadata

  • Download URL: docstring-to-markdown-0.13.tar.gz
  • Upload date:
  • Size: 26.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.18

File hashes

Hashes for docstring-to-markdown-0.13.tar.gz
Algorithm Hash digest
SHA256 3025c428638ececae920d6d26054546a20335af3504a145327e657e7ad7ce1ce
MD5 da71ebf2b40d56f7fe56100a4816db96
BLAKE2b-256 2b114be3230b6ebaeb31b2406876367243780d10a28da3a881a45a960ed4469b

See more details on using hashes here.

File details

Details for the file docstring_to_markdown-0.13-py3-none-any.whl.

File metadata

File hashes

Hashes for docstring_to_markdown-0.13-py3-none-any.whl
Algorithm Hash digest
SHA256 aa487059d0883e70e54da25c7b230e918d9e4d40f23d6dfaa2b73e4225b2d7dd
MD5 0500f4d492195f7e94639245cb919de6
BLAKE2b-256 be4f1b6eb5a6d92ae52f3798e9fdffd225f1bcd017172bb732743315390a9025

See more details on using hashes here.

Supported by

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