griffe2md is a Python library that generates API documentation in Markdown format. It leverages Griffe for parsing Python source code and uses Jinja templates to render the extracted API data into Markdown, similar to how mkdocstrings-python generates HTML but for Markdown output. It primarily provides a command-line interface for ease of use. The library is actively maintained, currently at version 1.5.0, with regular updates addressing features and bug fixes.
pip install griffe2mdNo compatibility data collected yet for this library.
To generate Markdown API documentation for a Python package, simply run the `griffe2md` command with the path to your source package. Use the `-o` or `--output` option to save the output to a file instead of standard output.
Ensure `griffelib` is installed. If `griffe2md` was installed in an environment with a pinned `griffe` dependency, consider upgrading `griffe2md` or manually installing `griffelib`. [cite: "Depend on griffelib instead of griffe ([5c9b7e0](https://github.com/mkdocstrings/griffe2md/commit/5c9b7e02cf4deb1f4aa317379f4a13d5a1492e96) by Timothée Mazzucotelli)."]
If you relied on automatic Markdown formatting, you will need to run `mdformat` separately on the generated output, or check for new configuration options in `griffe2md` to re-enable formatting if available. Version 1.3.0 added a parameter to *prevent* formatting, indicating the shift in default behavior. [cite: "Don't format code with mdformat by defa"]
Upgrade `griffe2md` to version 1.3.3 or later to benefit from fixes for escaping pipes in table cells and replacing newlines with `<br>` tags in table descriptions. [cite: "Remove extra `}}` in Jinja template ([cb8aeaf](https://github.com/mkdocstrings/griffe2md/commit/cb8aeaf9d230c9b702f002a9bb5cb8e85dd9a83b) by Timothée Mazzucotelli). [Issue-24](https://github.com/mkdocstrings/griffe2md/issues/24)", "Escape pipes in table cells ([0e1da47](https://github.com/mkdocstrings/griffe2md/commit/0e1da47) by Timothée Mazzucotelli).", "Replace newlines with `<br>` tags in table descriptions ([afd7ef0](https://github.com/mkdocstrings/griffe2md/commit/afd7ef0856c317064281d5ab3490e4d0ea437142) by Timothée Mazzucotelli). [Issue-16](https://github.com/mkdocstrings/griffe2md/issues/16)"]
Ensure `griffelib` is installed: `pip install griffelib`. It is recommended to upgrade `griffe2md` to the latest version to get the correct dependency automatically: `pip install --upgrade griffe2md`.
If automatic formatting is desired, run an external formatter like `mdformat` on the output file after `griffe2md` has generated it: `griffe2md markdown my_package > docs.md && mdformat docs.md`.
Upgrade `griffe2md` to the latest version (`1.3.3` or newer) to include fixes for table rendering issues: `pip install --upgrade griffe2md`.