caffy 2026.7.24__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- caffy-2026.7.24/AGENTS.md +61 -0
- caffy-2026.7.24/LICENSE +21 -0
- caffy-2026.7.24/MANIFEST.in +5 -0
- caffy-2026.7.24/PKG-INFO +202 -0
- caffy-2026.7.24/README.md +173 -0
- caffy-2026.7.24/pyproject.toml +114 -0
- caffy-2026.7.24/setup.cfg +4 -0
- caffy-2026.7.24/src/caffy.egg-info/PKG-INFO +202 -0
- caffy-2026.7.24/src/caffy.egg-info/SOURCES.txt +37 -0
- caffy-2026.7.24/src/caffy.egg-info/dependency_links.txt +1 -0
- caffy-2026.7.24/src/caffy.egg-info/entry_points.txt +2 -0
- caffy-2026.7.24/src/caffy.egg-info/requires.txt +1 -0
- caffy-2026.7.24/src/caffy.egg-info/top_level.txt +1 -0
- caffy-2026.7.24/src/sphinx_caffy/__init__.py +152 -0
- caffy-2026.7.24/src/sphinx_caffy/_components.py +48 -0
- caffy-2026.7.24/src/sphinx_caffy/_config.py +189 -0
- caffy-2026.7.24/src/sphinx_caffy/_directives.py +307 -0
- caffy-2026.7.24/src/sphinx_caffy/_kinds.py +68 -0
- caffy-2026.7.24/src/sphinx_caffy/_lexers.py +61 -0
- caffy-2026.7.24/src/sphinx_caffy/_overloads.py +72 -0
- caffy-2026.7.24/src/sphinx_caffy/_semantic.py +4497 -0
- caffy-2026.7.24/src/sphinx_caffy/_version.py +5 -0
- caffy-2026.7.24/src/sphinx_caffy/_viewcode.py +128 -0
- caffy-2026.7.24/src/sphinx_caffy/locale/ja/LC_MESSAGES/sphinx_caffy.mo +0 -0
- caffy-2026.7.24/src/sphinx_caffy/locale/ja/LC_MESSAGES/sphinx_caffy.po +191 -0
- caffy-2026.7.24/src/sphinx_caffy/py.typed +1 -0
- caffy-2026.7.24/src/sphinx_caffy/theme/components.html +27 -0
- caffy-2026.7.24/src/sphinx_caffy/theme/layout.html +296 -0
- caffy-2026.7.24/src/sphinx_caffy/theme/search.html +41 -0
- caffy-2026.7.24/src/sphinx_caffy/theme/static/caffy-axis.js +255 -0
- caffy-2026.7.24/src/sphinx_caffy/theme/static/caffy-mark.svg +32 -0
- caffy-2026.7.24/src/sphinx_caffy/theme/static/caffy.css +8679 -0
- caffy-2026.7.24/src/sphinx_caffy/theme/static/caffy.js +3827 -0
- caffy-2026.7.24/src/sphinx_caffy/theme/static/fonts/OFL-Caffy-Code.txt +93 -0
- caffy-2026.7.24/src/sphinx_caffy/theme/static/fonts/OFL-Cormorant-Garamond.txt +93 -0
- caffy-2026.7.24/src/sphinx_caffy/theme/static/fonts/caffy-code-latin-wght-italic.woff2 +0 -0
- caffy-2026.7.24/src/sphinx_caffy/theme/static/fonts/caffy-code-latin-wght.woff2 +0 -0
- caffy-2026.7.24/src/sphinx_caffy/theme/static/fonts/cormorant-garamond-latin-wght-italic.woff2 +0 -0
- caffy-2026.7.24/src/sphinx_caffy/theme/theme.toml +15 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# Contributor rules
|
|
2
|
+
|
|
3
|
+
## Change rules
|
|
4
|
+
|
|
5
|
+
- Preserve the `caffy-` and `data-caffy-` HTML vocabulary.
|
|
6
|
+
- Derive API kinds, routes, hierarchy, and page context from Sphinx build-time
|
|
7
|
+
metadata.
|
|
8
|
+
- Keep behavior changes separate from mechanical refactors and add a regression
|
|
9
|
+
test for every fixed edge case.
|
|
10
|
+
- Document the license of third-party code or assets added to the repository.
|
|
11
|
+
|
|
12
|
+
## Required checks
|
|
13
|
+
|
|
14
|
+
Run these from a clean checkout:
|
|
15
|
+
|
|
16
|
+
```console
|
|
17
|
+
uv sync --group quality --group test --group package --locked
|
|
18
|
+
uv run --no-sync ruff check .
|
|
19
|
+
uv run --no-sync ruff format --check .
|
|
20
|
+
uv run --no-sync basedpyright
|
|
21
|
+
node --check src/sphinx_caffy/theme/static/caffy.js
|
|
22
|
+
node --check src/sphinx_caffy/theme/static/caffy-axis.js
|
|
23
|
+
uv run --no-sync pytest -m "not browser"
|
|
24
|
+
uv run --no-sync sphinx-build -E -j auto -n -W --keep-going -b html docs docs/_build/html
|
|
25
|
+
uv run --no-sync sphinx-build -E -j auto -n -W --keep-going -b text docs docs/_build/text
|
|
26
|
+
uv run --no-sync python -m build
|
|
27
|
+
uv run --no-sync twine check --strict dist/*
|
|
28
|
+
uv run --no-sync check-wheel-contents dist/*.whl
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Visual changes also require the browser contract in Chromium, Firefox, and
|
|
32
|
+
WebKit with `CAFFY_BROWSER_TESTS=1` and the matching
|
|
33
|
+
`CAFFY_BROWSER` value.
|
|
34
|
+
|
|
35
|
+
## Local preview
|
|
36
|
+
|
|
37
|
+
Refresh the local preview through the repository script so Sphinx environment
|
|
38
|
+
state and static asset fingerprints are always regenerated:
|
|
39
|
+
|
|
40
|
+
```console
|
|
41
|
+
mise use uv@latest
|
|
42
|
+
uv run --no-sync python scripts/build_preview.py
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
The default preview build reuses the Sphinx environment and automatically
|
|
46
|
+
promotes itself to a full rebuild when build-time Python inputs change or a
|
|
47
|
+
source page is removed. Use `--clean` to force a fresh output directory.
|
|
48
|
+
|
|
49
|
+
## Release
|
|
50
|
+
|
|
51
|
+
The version source is `src/sphinx_caffy/_version.py`. Keep it aligned
|
|
52
|
+
with the translation catalog's `Project-Id-Version` and the release noted in
|
|
53
|
+
`README.md`.
|
|
54
|
+
|
|
55
|
+
Tag only after CI passes. Publication also requires the repository variable
|
|
56
|
+
`CAFFY_PUBLISH=true`.
|
|
57
|
+
|
|
58
|
+
## Security and licenses
|
|
59
|
+
|
|
60
|
+
Report vulnerabilities privately. Caffy is MIT licensed; Sphinx retains
|
|
61
|
+
its BSD 2-Clause License.
|
caffy-2026.7.24/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Caffy contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
caffy-2026.7.24/PKG-INFO
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: caffy
|
|
3
|
+
Version: 2026.7.24
|
|
4
|
+
Summary: An independent, accessible Sphinx theme for structured library documentation
|
|
5
|
+
Author: Caffy contributors
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/Nekch0/caffy
|
|
8
|
+
Project-URL: Documentation, https://github.com/Nekch0/caffy#readme
|
|
9
|
+
Project-URL: Repository, https://github.com/Nekch0/caffy.git
|
|
10
|
+
Project-URL: Issues, https://github.com/Nekch0/caffy/issues
|
|
11
|
+
Project-URL: Releases, https://github.com/Nekch0/caffy/releases
|
|
12
|
+
Keywords: documentation,sphinx,sphinx-theme,python,api-reference
|
|
13
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
14
|
+
Classifier: Environment :: Web Environment
|
|
15
|
+
Classifier: Framework :: Sphinx :: Theme
|
|
16
|
+
Classifier: Intended Audience :: Developers
|
|
17
|
+
Classifier: Operating System :: OS Independent
|
|
18
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
22
|
+
Classifier: Topic :: Documentation
|
|
23
|
+
Classifier: Topic :: Software Development :: Documentation
|
|
24
|
+
Requires-Python: >=3.12
|
|
25
|
+
Description-Content-Type: text/markdown
|
|
26
|
+
License-File: LICENSE
|
|
27
|
+
Requires-Dist: Sphinx<10,>=9.1
|
|
28
|
+
Dynamic: license-file
|
|
29
|
+
|
|
30
|
+
# Caffy
|
|
31
|
+
|
|
32
|
+
Caffy is an independent Sphinx theme for library and API documentation.
|
|
33
|
+
It provides responsive navigation, light and dark modes, keyboard access, and
|
|
34
|
+
build-time semantic styling for Python API objects.
|
|
35
|
+
|
|
36
|
+

|
|
37
|
+
|
|
38
|
+
The distribution and Sphinx theme are named `caffy`; the Python import
|
|
39
|
+
package is `sphinx_caffy`.
|
|
40
|
+
|
|
41
|
+
Requires Python >=3.12 and Sphinx >=9.1,<10. Current release: `2026.7.24`.
|
|
42
|
+
|
|
43
|
+
## Install
|
|
44
|
+
|
|
45
|
+
```console
|
|
46
|
+
uv add caffy
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
With pip, use `python -m pip install caffy`.
|
|
50
|
+
|
|
51
|
+
Select the theme in `conf.py`. Sphinx discovers the installed theme without an
|
|
52
|
+
extension entry:
|
|
53
|
+
|
|
54
|
+
```python
|
|
55
|
+
html_theme = "caffy"
|
|
56
|
+
html_theme_options = {
|
|
57
|
+
"accent": "amber", # amber, indigo, rose, or teal
|
|
58
|
+
"color_mode": "auto", # auto, light, or dark
|
|
59
|
+
"navigation_depth": "4",
|
|
60
|
+
"show_page_toc": "true",
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Build with warnings treated as errors:
|
|
65
|
+
|
|
66
|
+
```console
|
|
67
|
+
sphinx-build -E -j auto -n -W --keep-going -b html docs docs/_build/html
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## API documentation helpers
|
|
71
|
+
|
|
72
|
+
Use the metadata-only directive on package and module pages whose heading is
|
|
73
|
+
an API name:
|
|
74
|
+
|
|
75
|
+
```rst
|
|
76
|
+
.. caffy-page-kind:: package
|
|
77
|
+
:title-is-api-name:
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Omit `:title-is-api-name:` when the heading is prose such as “API reference”.
|
|
81
|
+
|
|
82
|
+
Create a compatibility route without registering the Python object twice:
|
|
83
|
+
|
|
84
|
+
```rst
|
|
85
|
+
.. caffy-api-alias:: package.LegacyReader
|
|
86
|
+
:canonical: package.storage.Reader
|
|
87
|
+
:kind: class
|
|
88
|
+
|
|
89
|
+
This route remains available for compatibility.
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Projects that use `caffy-api-alias` with non-HTML builders must load the
|
|
93
|
+
extension explicitly so the directive is registered independently of HTML
|
|
94
|
+
theme discovery:
|
|
95
|
+
|
|
96
|
+
```python
|
|
97
|
+
extensions = ["sphinx_caffy"]
|
|
98
|
+
html_theme = "caffy"
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Group arbitrary code samples behind progressively enhanced tabs:
|
|
102
|
+
|
|
103
|
+
```rst
|
|
104
|
+
.. caffy-tabs::
|
|
105
|
+
:label: Operating system
|
|
106
|
+
|
|
107
|
+
.. caffy-tab:: Windows
|
|
108
|
+
:selected:
|
|
109
|
+
|
|
110
|
+
.. code-block:: powershell
|
|
111
|
+
|
|
112
|
+
py -m pip install package-name
|
|
113
|
+
|
|
114
|
+
.. caffy-tab:: Linux
|
|
115
|
+
|
|
116
|
+
.. code-block:: bash
|
|
117
|
+
|
|
118
|
+
python -m pip install package-name
|
|
119
|
+
|
|
120
|
+
.. caffy-tab:: macOS
|
|
121
|
+
|
|
122
|
+
.. code-block:: bash
|
|
123
|
+
|
|
124
|
+
python -m pip install package-name
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
Labels are author-defined. Arrow keys, Home, and End move between tabs; without
|
|
128
|
+
JavaScript and in print output, every labeled panel remains visible. Projects
|
|
129
|
+
that build this directive with non-HTML builders must include
|
|
130
|
+
`"sphinx_caffy"` in `extensions`.
|
|
131
|
+
|
|
132
|
+
Use Sphinx `autosummary` when an API directory should show each object's
|
|
133
|
+
one-sentence description. Enable the extension in `conf.py`:
|
|
134
|
+
|
|
135
|
+
```python
|
|
136
|
+
extensions = ["sphinx.ext.autosummary"]
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Then list importable objects under their current module:
|
|
140
|
+
|
|
141
|
+
```rst
|
|
142
|
+
.. currentmodule:: package.storage
|
|
143
|
+
|
|
144
|
+
.. autosummary::
|
|
145
|
+
:signatures: none
|
|
146
|
+
|
|
147
|
+
Reader
|
|
148
|
+
open_store
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
Sphinx extracts the first valid sentence from each docstring. Caffy keeps
|
|
152
|
+
the native summary table and adds API-kind styling from build-time metadata.
|
|
153
|
+
|
|
154
|
+
Mark an ordinary Sphinx list as a kind-aware API directory:
|
|
155
|
+
|
|
156
|
+
```rst
|
|
157
|
+
.. rst-class:: caffy-api-index
|
|
158
|
+
|
|
159
|
+
* :py:class:`package.storage.Reader`
|
|
160
|
+
* :py:func:`package.open_store`
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
The manual `caffy-api-index` form is useful for route-only or hierarchical lists
|
|
164
|
+
that do not need docstring summaries.
|
|
165
|
+
|
|
166
|
+
Add `caffy-api-hierarchy` for accessible expand/collapse controls on nested API
|
|
167
|
+
lists. Generated `:doc:` package trees may add `caffy-kind-package` or
|
|
168
|
+
`caffy-kind-module` to each list item.
|
|
169
|
+
|
|
170
|
+
## Develop
|
|
171
|
+
|
|
172
|
+
See [the specification](docs/reference/specification.md) for the public behavior and
|
|
173
|
+
[AGENTS.md](AGENTS.md) for checks and release rules.
|
|
174
|
+
|
|
175
|
+
Reuse the Sphinx environment for the normal local preview:
|
|
176
|
+
|
|
177
|
+
```console
|
|
178
|
+
uv run --no-sync python scripts/build_preview.py
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
Use `--clean` after changing build configuration or whenever a completely fresh
|
|
182
|
+
output is required. The script also selects a full rebuild automatically when
|
|
183
|
+
build-time Python inputs change or a source page is removed.
|
|
184
|
+
|
|
185
|
+
## Versioning
|
|
186
|
+
|
|
187
|
+
Caffy uses calendar versions in `YYYY.M.D` form. A second corrective release on
|
|
188
|
+
the same day adds a PEP 440 post-release suffix, such as `2026.7.24.post1`.
|
|
189
|
+
Release tags add a leading `v`, for example `v2026.7.24`.
|
|
190
|
+
|
|
191
|
+
## License
|
|
192
|
+
|
|
193
|
+
Caffy source code is licensed under the MIT License. Sphinx is a runtime
|
|
194
|
+
dependency and retains its BSD 2-Clause License. The theme's search template
|
|
195
|
+
preserves the script integration contract of Sphinx's BSD-licensed basic theme.
|
|
196
|
+
The bundled Cormorant Garamond font remains licensed under the SIL Open Font
|
|
197
|
+
License 1.1. Its copyright notice and complete license text are distributed in
|
|
198
|
+
[OFL-Cormorant-Garamond.txt](src/sphinx_caffy/theme/static/fonts/OFL-Cormorant-Garamond.txt).
|
|
199
|
+
The bundled code font is a renamed subset of Monaspace Argon and remains
|
|
200
|
+
licensed under the SIL Open Font License 1.1. Its copyright notice and complete
|
|
201
|
+
license text are distributed in
|
|
202
|
+
[OFL-Caffy-Code.txt](src/sphinx_caffy/theme/static/fonts/OFL-Caffy-Code.txt).
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
# Caffy
|
|
2
|
+
|
|
3
|
+
Caffy is an independent Sphinx theme for library and API documentation.
|
|
4
|
+
It provides responsive navigation, light and dark modes, keyboard access, and
|
|
5
|
+
build-time semantic styling for Python API objects.
|
|
6
|
+
|
|
7
|
+

|
|
8
|
+
|
|
9
|
+
The distribution and Sphinx theme are named `caffy`; the Python import
|
|
10
|
+
package is `sphinx_caffy`.
|
|
11
|
+
|
|
12
|
+
Requires Python >=3.12 and Sphinx >=9.1,<10. Current release: `2026.7.24`.
|
|
13
|
+
|
|
14
|
+
## Install
|
|
15
|
+
|
|
16
|
+
```console
|
|
17
|
+
uv add caffy
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
With pip, use `python -m pip install caffy`.
|
|
21
|
+
|
|
22
|
+
Select the theme in `conf.py`. Sphinx discovers the installed theme without an
|
|
23
|
+
extension entry:
|
|
24
|
+
|
|
25
|
+
```python
|
|
26
|
+
html_theme = "caffy"
|
|
27
|
+
html_theme_options = {
|
|
28
|
+
"accent": "amber", # amber, indigo, rose, or teal
|
|
29
|
+
"color_mode": "auto", # auto, light, or dark
|
|
30
|
+
"navigation_depth": "4",
|
|
31
|
+
"show_page_toc": "true",
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Build with warnings treated as errors:
|
|
36
|
+
|
|
37
|
+
```console
|
|
38
|
+
sphinx-build -E -j auto -n -W --keep-going -b html docs docs/_build/html
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## API documentation helpers
|
|
42
|
+
|
|
43
|
+
Use the metadata-only directive on package and module pages whose heading is
|
|
44
|
+
an API name:
|
|
45
|
+
|
|
46
|
+
```rst
|
|
47
|
+
.. caffy-page-kind:: package
|
|
48
|
+
:title-is-api-name:
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Omit `:title-is-api-name:` when the heading is prose such as “API reference”.
|
|
52
|
+
|
|
53
|
+
Create a compatibility route without registering the Python object twice:
|
|
54
|
+
|
|
55
|
+
```rst
|
|
56
|
+
.. caffy-api-alias:: package.LegacyReader
|
|
57
|
+
:canonical: package.storage.Reader
|
|
58
|
+
:kind: class
|
|
59
|
+
|
|
60
|
+
This route remains available for compatibility.
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Projects that use `caffy-api-alias` with non-HTML builders must load the
|
|
64
|
+
extension explicitly so the directive is registered independently of HTML
|
|
65
|
+
theme discovery:
|
|
66
|
+
|
|
67
|
+
```python
|
|
68
|
+
extensions = ["sphinx_caffy"]
|
|
69
|
+
html_theme = "caffy"
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Group arbitrary code samples behind progressively enhanced tabs:
|
|
73
|
+
|
|
74
|
+
```rst
|
|
75
|
+
.. caffy-tabs::
|
|
76
|
+
:label: Operating system
|
|
77
|
+
|
|
78
|
+
.. caffy-tab:: Windows
|
|
79
|
+
:selected:
|
|
80
|
+
|
|
81
|
+
.. code-block:: powershell
|
|
82
|
+
|
|
83
|
+
py -m pip install package-name
|
|
84
|
+
|
|
85
|
+
.. caffy-tab:: Linux
|
|
86
|
+
|
|
87
|
+
.. code-block:: bash
|
|
88
|
+
|
|
89
|
+
python -m pip install package-name
|
|
90
|
+
|
|
91
|
+
.. caffy-tab:: macOS
|
|
92
|
+
|
|
93
|
+
.. code-block:: bash
|
|
94
|
+
|
|
95
|
+
python -m pip install package-name
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Labels are author-defined. Arrow keys, Home, and End move between tabs; without
|
|
99
|
+
JavaScript and in print output, every labeled panel remains visible. Projects
|
|
100
|
+
that build this directive with non-HTML builders must include
|
|
101
|
+
`"sphinx_caffy"` in `extensions`.
|
|
102
|
+
|
|
103
|
+
Use Sphinx `autosummary` when an API directory should show each object's
|
|
104
|
+
one-sentence description. Enable the extension in `conf.py`:
|
|
105
|
+
|
|
106
|
+
```python
|
|
107
|
+
extensions = ["sphinx.ext.autosummary"]
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Then list importable objects under their current module:
|
|
111
|
+
|
|
112
|
+
```rst
|
|
113
|
+
.. currentmodule:: package.storage
|
|
114
|
+
|
|
115
|
+
.. autosummary::
|
|
116
|
+
:signatures: none
|
|
117
|
+
|
|
118
|
+
Reader
|
|
119
|
+
open_store
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
Sphinx extracts the first valid sentence from each docstring. Caffy keeps
|
|
123
|
+
the native summary table and adds API-kind styling from build-time metadata.
|
|
124
|
+
|
|
125
|
+
Mark an ordinary Sphinx list as a kind-aware API directory:
|
|
126
|
+
|
|
127
|
+
```rst
|
|
128
|
+
.. rst-class:: caffy-api-index
|
|
129
|
+
|
|
130
|
+
* :py:class:`package.storage.Reader`
|
|
131
|
+
* :py:func:`package.open_store`
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
The manual `caffy-api-index` form is useful for route-only or hierarchical lists
|
|
135
|
+
that do not need docstring summaries.
|
|
136
|
+
|
|
137
|
+
Add `caffy-api-hierarchy` for accessible expand/collapse controls on nested API
|
|
138
|
+
lists. Generated `:doc:` package trees may add `caffy-kind-package` or
|
|
139
|
+
`caffy-kind-module` to each list item.
|
|
140
|
+
|
|
141
|
+
## Develop
|
|
142
|
+
|
|
143
|
+
See [the specification](docs/reference/specification.md) for the public behavior and
|
|
144
|
+
[AGENTS.md](AGENTS.md) for checks and release rules.
|
|
145
|
+
|
|
146
|
+
Reuse the Sphinx environment for the normal local preview:
|
|
147
|
+
|
|
148
|
+
```console
|
|
149
|
+
uv run --no-sync python scripts/build_preview.py
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
Use `--clean` after changing build configuration or whenever a completely fresh
|
|
153
|
+
output is required. The script also selects a full rebuild automatically when
|
|
154
|
+
build-time Python inputs change or a source page is removed.
|
|
155
|
+
|
|
156
|
+
## Versioning
|
|
157
|
+
|
|
158
|
+
Caffy uses calendar versions in `YYYY.M.D` form. A second corrective release on
|
|
159
|
+
the same day adds a PEP 440 post-release suffix, such as `2026.7.24.post1`.
|
|
160
|
+
Release tags add a leading `v`, for example `v2026.7.24`.
|
|
161
|
+
|
|
162
|
+
## License
|
|
163
|
+
|
|
164
|
+
Caffy source code is licensed under the MIT License. Sphinx is a runtime
|
|
165
|
+
dependency and retains its BSD 2-Clause License. The theme's search template
|
|
166
|
+
preserves the script integration contract of Sphinx's BSD-licensed basic theme.
|
|
167
|
+
The bundled Cormorant Garamond font remains licensed under the SIL Open Font
|
|
168
|
+
License 1.1. Its copyright notice and complete license text are distributed in
|
|
169
|
+
[OFL-Cormorant-Garamond.txt](src/sphinx_caffy/theme/static/fonts/OFL-Cormorant-Garamond.txt).
|
|
170
|
+
The bundled code font is a renamed subset of Monaspace Argon and remains
|
|
171
|
+
licensed under the SIL Open Font License 1.1. Its copyright notice and complete
|
|
172
|
+
license text are distributed in
|
|
173
|
+
[OFL-Caffy-Code.txt](src/sphinx_caffy/theme/static/fonts/OFL-Caffy-Code.txt).
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools==83.0.0"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "caffy"
|
|
7
|
+
dynamic = ["version"]
|
|
8
|
+
description = "An independent, accessible Sphinx theme for structured library documentation"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = "MIT"
|
|
11
|
+
license-files = ["LICENSE"]
|
|
12
|
+
requires-python = ">=3.12"
|
|
13
|
+
authors = [
|
|
14
|
+
{ name = "Caffy contributors" },
|
|
15
|
+
]
|
|
16
|
+
keywords = ["documentation", "sphinx", "sphinx-theme", "python", "api-reference"]
|
|
17
|
+
classifiers = [
|
|
18
|
+
"Development Status :: 5 - Production/Stable",
|
|
19
|
+
"Environment :: Web Environment",
|
|
20
|
+
"Framework :: Sphinx :: Theme",
|
|
21
|
+
"Intended Audience :: Developers",
|
|
22
|
+
"Operating System :: OS Independent",
|
|
23
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
24
|
+
"Programming Language :: Python :: 3.12",
|
|
25
|
+
"Programming Language :: Python :: 3.13",
|
|
26
|
+
"Programming Language :: Python :: 3.14",
|
|
27
|
+
"Topic :: Documentation",
|
|
28
|
+
"Topic :: Software Development :: Documentation",
|
|
29
|
+
]
|
|
30
|
+
dependencies = [
|
|
31
|
+
"Sphinx>=9.1,<10",
|
|
32
|
+
]
|
|
33
|
+
|
|
34
|
+
[project.urls]
|
|
35
|
+
Homepage = "https://github.com/Nekch0/caffy"
|
|
36
|
+
Documentation = "https://github.com/Nekch0/caffy#readme"
|
|
37
|
+
Repository = "https://github.com/Nekch0/caffy.git"
|
|
38
|
+
Issues = "https://github.com/Nekch0/caffy/issues"
|
|
39
|
+
Releases = "https://github.com/Nekch0/caffy/releases"
|
|
40
|
+
|
|
41
|
+
[dependency-groups]
|
|
42
|
+
quality = [
|
|
43
|
+
"basedpyright>=1.31,<2",
|
|
44
|
+
"ruff>=0.12,<1",
|
|
45
|
+
]
|
|
46
|
+
build = [
|
|
47
|
+
"build>=1.2,!=1.5.1,<2", # 1.5.1 was yanked for breaking changes.
|
|
48
|
+
]
|
|
49
|
+
test = [
|
|
50
|
+
{ include-group = "build" },
|
|
51
|
+
"beautifulsoup4>=4.13,<5",
|
|
52
|
+
"myst-parser>=5,<6",
|
|
53
|
+
"pytest>=8.3,<10",
|
|
54
|
+
]
|
|
55
|
+
package = [
|
|
56
|
+
{ include-group = "build" },
|
|
57
|
+
"check-wheel-contents>=0.6,<1",
|
|
58
|
+
"twine>=6,<7",
|
|
59
|
+
]
|
|
60
|
+
browser = [
|
|
61
|
+
{ include-group = "test" },
|
|
62
|
+
"axe-playwright-python>=0.1.7,<0.2",
|
|
63
|
+
"playwright>=1.55,<2",
|
|
64
|
+
]
|
|
65
|
+
|
|
66
|
+
[project.entry-points."sphinx.html_themes"]
|
|
67
|
+
caffy = "sphinx_caffy"
|
|
68
|
+
|
|
69
|
+
[tool.setuptools]
|
|
70
|
+
package-dir = { "" = "src" }
|
|
71
|
+
include-package-data = false
|
|
72
|
+
|
|
73
|
+
[tool.setuptools.dynamic]
|
|
74
|
+
version = { attr = "sphinx_caffy._version.__version__" }
|
|
75
|
+
|
|
76
|
+
[tool.setuptools.packages.find]
|
|
77
|
+
where = ["src"]
|
|
78
|
+
|
|
79
|
+
[tool.setuptools.package-data]
|
|
80
|
+
sphinx_caffy = [
|
|
81
|
+
"py.typed",
|
|
82
|
+
"locale/*/LC_MESSAGES/*.mo",
|
|
83
|
+
"theme/*.html",
|
|
84
|
+
"theme/*.toml",
|
|
85
|
+
"theme/static/*.css",
|
|
86
|
+
"theme/static/*.js",
|
|
87
|
+
"theme/static/*.svg",
|
|
88
|
+
"theme/static/fonts/*.txt",
|
|
89
|
+
"theme/static/fonts/*.woff2",
|
|
90
|
+
]
|
|
91
|
+
|
|
92
|
+
[tool.pytest.ini_options]
|
|
93
|
+
addopts = "-ra --strict-config --strict-markers"
|
|
94
|
+
testpaths = ["tests"]
|
|
95
|
+
markers = [
|
|
96
|
+
"browser: cross-browser end-to-end contract tests",
|
|
97
|
+
]
|
|
98
|
+
|
|
99
|
+
[tool.ruff]
|
|
100
|
+
target-version = "py312"
|
|
101
|
+
line-length = 100
|
|
102
|
+
|
|
103
|
+
[tool.ruff.lint]
|
|
104
|
+
select = ["E", "F", "I", "N", "PERF", "RUF", "S", "UP", "W"]
|
|
105
|
+
ignore = ["S101"]
|
|
106
|
+
|
|
107
|
+
[tool.ruff.lint.per-file-ignores]
|
|
108
|
+
"tests/*" = ["S603"]
|
|
109
|
+
|
|
110
|
+
[tool.pyright]
|
|
111
|
+
include = ["src", "tests", "docs"]
|
|
112
|
+
exclude = ["docs/_build"]
|
|
113
|
+
pythonVersion = "3.12"
|
|
114
|
+
typeCheckingMode = "standard"
|