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+ (tested on 3.7 up to 3.11)
  • 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.15.tar.gz (29.2 kB view details)

Uploaded Source

Built Distribution

docstring_to_markdown-0.15-py3-none-any.whl (21.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for docstring-to-markdown-0.15.tar.gz
Algorithm Hash digest
SHA256 e146114d9c50c181b1d25505054a8d0f7a476837f0da2c19f07e06eaed52b73d
MD5 fe2d4afd2e75807fc8b72957aaef8a29
BLAKE2b-256 7aad6a66abd14676619bd56f6b924c96321a2e2d7d86558841d94a30023eec53

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for docstring_to_markdown-0.15-py3-none-any.whl
Algorithm Hash digest
SHA256 27afb3faedba81e34c33521c32bbd258d7fbb79eedf7d29bc4e81080e854aec0
MD5 0e4c4f2f60fba46c0b1b136e9262d89e
BLAKE2b-256 c1cf4eee59f6c4111b3e80cc32cf6bac483a90646f5c8693e84496c9855e8e38

See more details on using hashes here.

Provenance

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