Generate Fern API documentation from Python packages using static analysis.
Simplified fork of sphinx-autodoc2 focused purely on Python → Fern markdown output.
pipx install py2fernGenerate Fern markdown documentation:
py2fern write /path/to/your/packageSpecify output directory:
py2fern write /path/to/your/package --output ./docs/apiThis creates:
- MDX files with Fern-compatible frontmatter and slugs
navigation.ymlfor Fern docs structure
This project is a fork of the excellent sphinx-autodoc2 by Chris Sewell. All credit for the core functionality goes to the original project.
All configuration is mainly in pyproject.toml.
Use tox to run the tests.
pipx install tox
tox -avUse pre-commit to run the linters and formatters.
pipx install pre-commit
pre-commit run --all-files
# pre-commit installflit is used to build the package.
pipx install flit
flit build