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.14.tar.gz (29.0 kB view details)

Uploaded Source

Built Distribution

docstring_to_markdown-0.14-py3-none-any.whl (21.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: docstring-to-markdown-0.14.tar.gz
  • Upload date:
  • Size: 29.0 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.14.tar.gz
Algorithm Hash digest
SHA256 f9b061b42ee848149e122a647013b4f0778141596230f3203fe7f5404b3e9ab2
MD5 6858dbcc527e1c841094dcad21f590c1
BLAKE2b-256 e18412e7183fbb8772e5a00ebfd48552ccbd4820621b1c2e624cc1a149297597

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for docstring_to_markdown-0.14-py3-none-any.whl
Algorithm Hash digest
SHA256 34a45627eec9d816a734790100ef2913e4ecc827315b18f32badc8c186bae293
MD5 3b7b6dd782d5f1a4385babf49b71382d
BLAKE2b-256 702c3324af107e43e70b3da6c510ecdfeaf44bf1949926531f24accab13650f8

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