Skip to content

Commit 0d2cb1d

Browse files
committed
v2
1 parent 56cb2d7 commit 0d2cb1d

File tree

7 files changed

+3193
-89
lines changed

7 files changed

+3193
-89
lines changed

README.md

Lines changed: 41 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
1-
# sphinx-autodoc2
1+
# sphinx-autodoc-fern
22

3-
`sphinx-autodoc2` is a Sphinx extension that automatically generates API documentation for your Python packages.
3+
`sphinx-autodoc-fern` is a Sphinx extension that automatically generates API documentation for your Python packages with **Fern documentation format support**.
44

5-
[![GitHub Repo stars](https://img.shields.io/github/stars/chrisjsewell/sphinx-autodoc2?label=Like%20and%20Share%21&style=social)](https://github.com/chrisjsewell/sphinx-autodoc2)
6-
[![PyPI](https://img.shields.io/pypi/v/sphinx-autodoc2?label=PyPI&logo=pypi&style=social)](https://pypi.org/project/sphinx-autodoc2/)
5+
This is a fork of [`sphinx-autodoc2`](https://github.com/sphinx-extensions2/sphinx-autodoc2) that adds powerful [Fern](https://buildwithfern.com) documentation generation capabilities.
6+
7+
## 🆕 New Fern Features
8+
9+
- **Fern-compatible Markdown output** - Generate documentation that works seamlessly with Fern
10+
- **Enhanced parameter formatting** - Uses Fern's ParamField components for better API documentation
11+
- **Smart callout handling** - Automatically converts NOTE: and WARNING: to Fern components
12+
- **Beautiful tables** - Improved formatting for classes, functions, and module contents
713

814
Static analysis of Python code
915

@@ -24,18 +30,45 @@ Support for both `rst` and `md` docstrings
2430

2531
Highly configurable
2632

27-
: `sphinx-autodoc2` is highly configurable, with many options to control the analysis and output of the documentation.
33+
: `sphinx-autodoc-fern` is highly configurable, with many options to control the analysis and output of the documentation.
34+
35+
Fern Documentation Format Support
36+
37+
: Generate beautiful Fern-compatible documentation with enhanced formatting for parameters, callouts, and API references.
2838

2939
Decoupled analysis and rendering
3040

3141
: The analysis and rendering of the documentation are decoupled, and not dependent on Sphinx.
32-
: This means that you can use `sphinx-autodoc2` to generate documentation outside of Sphinx (see the `autodoc2` command line tool).
42+
: This means that you can use `sphinx-autodoc-fern` to generate documentation outside of Sphinx (see the `autodoc2` command line tool).
43+
44+
## 🚀 Quick Start with Fern
45+
46+
```bash
47+
pip install sphinx-autodoc-fern
48+
```
49+
50+
To use the Fern renderer:
51+
52+
```python
53+
from autodoc2.render.fern_ import FernRenderer
54+
55+
renderer = FernRenderer()
56+
# Generate Fern-compatible documentation
57+
```
58+
59+
Or use with the CLI:
60+
61+
```bash
62+
autodoc2 --renderer fern your_package/
63+
```
64+
65+
## Acknowledgments
3366

34-
See the documentation for more information!
67+
This project is a fork of the excellent [`sphinx-autodoc2`](https://github.com/sphinx-extensions2/sphinx-autodoc2) by Chris Sewell. All credit for the core functionality goes to the original project.
3568

3669
## Design and comparison to sphinx-autoapi
3770

38-
I wanted an extension with the following goals:
71+
The original sphinx-autodoc2 was created with the following goals:
3972

4073
- Static analysis of Python code, so things like `if TYPE_CHECKING` were handled correctly
4174
- Support for MyST docstrings (see <https://github.com/executablebooks/MyST-Parser/issues/228>)

pyproject.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@ build-backend = "flit_core.buildapi"
66
name = "autodoc2"
77

88
[project]
9-
name = "sphinx-autodoc2"
9+
name = "sphinx-autodoc2-fern"
1010
dynamic = ["version", "description"]
11-
authors = [{name = "Chris Sewell", email = "chrisj_sewell@hotmail.com"}]
11+
authors = [{name = "Ryan Paul", email = "your-email@example.com"}]
1212
license = {file = "LICENSE"}
1313
classifiers = [
1414
"License :: OSI Approved :: MIT License",
1515
"Programming Language :: Python :: 3",
1616
"Framework :: Sphinx :: Extension",
1717
]
1818
readme = "README.md"
19-
keywords = ["sphinx", "autodoc", "extension", "documentation"]
20-
urls = {Home = "https://github.com/chrisjsewell/sphinx-autodoc2"}
19+
keywords = ["sphinx", "autodoc", "extension", "documentation", "fern", "api"]
20+
urls = {Home = "https://github.com/fern-api/sphinx-autodoc2-fern"}
2121
requires-python = ">=3.8"
2222
dependencies = [
2323
"astroid>=2.7,<4",

src/autodoc2/__init__.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
"""Analyse a python project and create documentation for it."""
1+
"""Analyse a python project and create documentation for it.
22
3-
__version__ = "0.5.0"
3+
This is a fork of sphinx-autodoc2 with added support for Fern documentation format.
4+
"""
5+
6+
__version__ = "0.1.0"
47

58

69
def setup(app): # type: ignore

0 commit comments

Comments
 (0)