The `docstring-to-markdown` library provides on-the-fly conversion of Python docstrings into Markdown format. It currently supports reStructuredText and has initial support for Google-formatted docstrings since version 0.13. The current version is 0.17, and it is actively maintained with a regular release cadence as evidenced by its release history on PyPI.
pip install docstring-to-markdownVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to use `docstring_to_markdown.convert` to transform both reStructuredText and Google-style Python docstrings into Markdown. It also shows how to handle `UnknownFormatError` for unrecognised input.
Format docstrings using recognized styles (reStructuredText or Google-style) or implement a custom converter via the extensibility entry point.
Manually extract docstrings (e.g., using `__doc__` attribute or `inspect` module) before passing them to `docstring_to_markdown.convert`.
Test the output for complex docstrings and simplify the docstring formatting if the generated Markdown is not as expected. For highly complex documentation needs, consider dedicated documentation generators like Sphinx with Markdown extensions.
No dependency data recorded yet.