sphinx-java-autodoc 0.2.0__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.
Files changed (65) hide show
  1. sphinx_java_autodoc-0.2.0/.gitignore +18 -0
  2. sphinx_java_autodoc-0.2.0/CONTRIBUTING.md +125 -0
  3. sphinx_java_autodoc-0.2.0/LICENSE +21 -0
  4. sphinx_java_autodoc-0.2.0/PKG-INFO +109 -0
  5. sphinx_java_autodoc-0.2.0/README.md +79 -0
  6. sphinx_java_autodoc-0.2.0/SECURITY.md +10 -0
  7. sphinx_java_autodoc-0.2.0/docs/adr/0001-jdk-doclet-xml-sphinx-domain.md +71 -0
  8. sphinx_java_autodoc-0.2.0/docs/agents/domain.md +51 -0
  9. sphinx_java_autodoc-0.2.0/docs/agents/issue-tracker.md +45 -0
  10. sphinx_java_autodoc-0.2.0/docs/alternatives.rst +108 -0
  11. sphinx_java_autodoc-0.2.0/docs/build-integration.rst +240 -0
  12. sphinx_java_autodoc-0.2.0/docs/compatibility.rst +106 -0
  13. sphinx_java_autodoc-0.2.0/docs/conf.py +49 -0
  14. sphinx_java_autodoc-0.2.0/docs/design.rst +35 -0
  15. sphinx_java_autodoc-0.2.0/docs/getting-started.rst +114 -0
  16. sphinx_java_autodoc-0.2.0/docs/guide.rst +96 -0
  17. sphinx_java_autodoc-0.2.0/docs/index.rst +58 -0
  18. sphinx_java_autodoc-0.2.0/docs/javadoc-support.rst +90 -0
  19. sphinx_java_autodoc-0.2.0/docs/performance.rst +74 -0
  20. sphinx_java_autodoc-0.2.0/docs/roadmap.md +18 -0
  21. sphinx_java_autodoc-0.2.0/docs/schema.md +69 -0
  22. sphinx_java_autodoc-0.2.0/docs/showcase.rst +24 -0
  23. sphinx_java_autodoc-0.2.0/docs/troubleshooting.rst +82 -0
  24. sphinx_java_autodoc-0.2.0/docs/usage.rst +183 -0
  25. sphinx_java_autodoc-0.2.0/examples/README.md +27 -0
  26. sphinx_java_autodoc-0.2.0/examples/build-consumer/BuildInfo.java.in +8 -0
  27. sphinx_java_autodoc-0.2.0/examples/build-consumer/src/demo/Consumer.java +14 -0
  28. sphinx_java_autodoc-0.2.0/examples/dependency/src/vendor/Token.java +3 -0
  29. sphinx_java_autodoc-0.2.0/examples/gradle/build.gradle +31 -0
  30. sphinx_java_autodoc-0.2.0/examples/gradle/settings.gradle +1 -0
  31. sphinx_java_autodoc-0.2.0/examples/maven/pom.xml +45 -0
  32. sphinx_java_autodoc-0.2.0/examples/standalone/docs/conf.py +17 -0
  33. sphinx_java_autodoc-0.2.0/examples/standalone/docs/guide.rst +20 -0
  34. sphinx_java_autodoc-0.2.0/examples/standalone/docs/index.rst +12 -0
  35. sphinx_java_autodoc-0.2.0/examples/standalone/docs/reference.rst +24 -0
  36. sphinx_java_autodoc-0.2.0/examples/standalone/src/demo/Label.java +12 -0
  37. sphinx_java_autodoc-0.2.0/examples/standalone/src/demo/Mode.java +10 -0
  38. sphinx_java_autodoc-0.2.0/examples/standalone/src/demo/Point.java +7 -0
  39. sphinx_java_autodoc-0.2.0/examples/standalone/src/demo/Transformer.java +15 -0
  40. sphinx_java_autodoc-0.2.0/examples/standalone/src/demo/Widget.java +80 -0
  41. sphinx_java_autodoc-0.2.0/examples/standalone/src/demo/package-info.java +2 -0
  42. sphinx_java_autodoc-0.2.0/pyproject.toml +75 -0
  43. sphinx_java_autodoc-0.2.0/src/sphinx_java_autodoc/__init__.py +239 -0
  44. sphinx_java_autodoc-0.2.0/src/sphinx_java_autodoc/__main__.py +67 -0
  45. sphinx_java_autodoc-0.2.0/src/sphinx_java_autodoc/domain.py +387 -0
  46. sphinx_java_autodoc-0.2.0/src/sphinx_java_autodoc/extractor.py +254 -0
  47. sphinx_java_autodoc-0.2.0/src/sphinx_java_autodoc/java/SphinxDoclet.java +1036 -0
  48. sphinx_java_autodoc-0.2.0/src/sphinx_java_autodoc/javadoc.py +45 -0
  49. sphinx_java_autodoc-0.2.0/src/sphinx_java_autodoc/model.py +173 -0
  50. sphinx_java_autodoc-0.2.0/src/sphinx_java_autodoc/render.py +469 -0
  51. sphinx_java_autodoc-0.2.0/src/sphinx_java_autodoc/static/java-autodoc.css +28 -0
  52. sphinx_java_autodoc-0.2.0/tests/benchmark.py +131 -0
  53. sphinx_java_autodoc-0.2.0/tests/build_tools_check.py +129 -0
  54. sphinx_java_autodoc-0.2.0/tests/test_boundaries.py +159 -0
  55. sphinx_java_autodoc-0.2.0/tests/test_conformance.py +93 -0
  56. sphinx_java_autodoc-0.2.0/tests/test_generic_throws.py +121 -0
  57. sphinx_java_autodoc-0.2.0/tests/test_integration.py +791 -0
  58. sphinx_java_autodoc-0.2.0/tests/test_javadoc.py +71 -0
  59. sphinx_java_autodoc-0.2.0/tests/test_navigation.py +189 -0
  60. sphinx_java_autodoc-0.2.0/tests/test_signatures.py +111 -0
  61. sphinx_java_autodoc-0.2.0/tests/test_snippets.py +123 -0
  62. sphinx_java_autodoc-0.2.0/tests/test_sourcepath.py +95 -0
  63. sphinx_java_autodoc-0.2.0/tests/test_tables.py +257 -0
  64. sphinx_java_autodoc-0.2.0/tests/test_value.py +181 -0
  65. sphinx_java_autodoc-0.2.0/tests/visual_check.py +140 -0
@@ -0,0 +1,18 @@
1
+ .venv*/
2
+ __pycache__/
3
+ .pytest_cache/
4
+ *.egg-info/
5
+ build/
6
+ dist/
7
+ docs/_build/
8
+ docs/api/
9
+ examples/**/target/
10
+ examples/**/build/
11
+ examples/**/docs/_build/
12
+ examples/**/docs/api/
13
+
14
+
15
+ .java-autodoc-cache/
16
+ .ruff_cache/
17
+ .DS_Store
18
+ examples/**/.gradle/
@@ -0,0 +1,125 @@
1
+ # Development
2
+
3
+ Install [uv](https://docs.astral.sh/uv/getting-started/installation/) and Temurin
4
+ JDK 25. Ensure `java`, `javac`, and `javadoc` are on `PATH`.
5
+
6
+ ```sh
7
+ uv sync --locked
8
+ uv run --locked pre-commit install
9
+ uv run --locked pre-commit run --all-files
10
+ uv run --locked pytest -q
11
+ uv run --locked --group showcase python showcase/build.py
12
+ uv run --locked sphinx-build -W --keep-going -n docs docs/_build/html
13
+ uv build
14
+ uv run --locked twine check --strict dist/*
15
+ ```
16
+
17
+ The docs link into the Apache Commons Lang showcase, so build it first:
18
+ `showcase/build.py` fetches the pinned commit, builds its site under
19
+ `build/showcase/commons-lang/html/<theme>/` in Furo, Read the Docs, Alabaster
20
+ and Lumina (the `showcase` dependency group), and fails when a theme's warning category
21
+ exceeds the shared baseline in `showcase/commons-lang/showcase.json`. After a change that removes
22
+ warnings, record the new counts with `--update-baseline`; an increase needs a
23
+ deliberate baseline update in the same change.
24
+
25
+ `pre-commit install` sets up the commit and commit-message hooks; CI runs the same
26
+ hooks in the Lint job. They cover Ruff lint and formatting, google-java-format for
27
+ the doclet (the formatter Spotless uses for Java, pinned by checksum),
28
+ `javac -Xlint:all -Werror`, actionlint, zizmor, typos, `pyproject.toml`
29
+ validation, RST pitfalls, `uv.lock` freshness and basic file hygiene. Commit
30
+ messages must use conventional prefixes such as `feat:`, `fix:` or `docs:`, and
31
+ direct commits to `main` are rejected. Hooks with `--fix`/`--autofix` rewrite
32
+ files; review and stage their changes. Python tools run through `uv run --locked`,
33
+ so their versions come from `uv.lock`.
34
+
35
+ Update dependencies with `uv lock --upgrade`, and commit `uv.lock` with changes to
36
+ `pyproject.toml`. CI uses `--locked` so a stale lockfile fails. Dependabot opens
37
+ weekly updates, after a seven-day cooldown, for Python packages, pinned GitHub
38
+ Actions and pre-commit hook revisions. To update hooks by hand, run
39
+ `uv run --locked pre-commit autoupdate --freeze`.
40
+
41
+ For the browser checks:
42
+
43
+ ```sh
44
+ uv sync --locked --extra test --group showcase
45
+ uv run --locked --extra test --group showcase playwright install chromium
46
+ for theme in alabaster classic furo sphinx_rtd_theme lumina; do
47
+ output=$theme; [ "$theme" = alabaster ] && output=html
48
+ uv run --locked --extra test --group showcase sphinx-build -W --keep-going -n \
49
+ -D "html_theme=$theme" examples/standalone/docs "examples/standalone/docs/_build/$output"
50
+ done
51
+ uv run --locked --extra test --group showcase python tests/visual_check.py
52
+ ```
53
+
54
+ Browser checks use the small site in `examples/standalone/docs`, which renders the
55
+ standalone fixture with every documented feature. They cover
56
+ desktop/mobile layouts, Java API structure and navigation in Alabaster, Classic,
57
+ Furo, Read the Docs and Lumina, including Sphinx's search page, and fail on
58
+ uncaught page errors. CI retains screenshots and a JSON report, including on failures.
59
+ API pages must not be wider than the theme's own layout, measured on the index and
60
+ on `reference.rst`, a page of native Sphinx objects with the same fields. Classic
61
+ keeps a minimum page width, and some themes overflow on phones for native objects.
62
+
63
+ The opt-in `uv run --locked python tests/build_tools_check.py` check needs Maven
64
+ and Gradle on PATH (or explicit `--maven`/`--gradle` executable paths). It runs the
65
+ consumer builds and verifies strict extraction and JDK-free publication. Build
66
+ tools resolve their declared dependencies explicitly. For real-project timing,
67
+ use `uv run --locked python tests/benchmark.py /prepared/source/root`; see
68
+ `docs/performance.rst` for the measured workload and limitations.
69
+
70
+ The required `All checks` status covers lint, compiler warnings, the test matrix,
71
+ source/wheel packaging, the Commons Lang showcase baseline, strict docs, browser
72
+ checks, Maven/Gradle consumers, and dependency auditing.
73
+ Package checks install the wheel built from the source archive and run the real
74
+ integration suite against that installation. Weekly CI also detects newly
75
+ reported vulnerabilities. The application remains an initial release; passing CI
76
+ does not extend the compatibility promises in `docs/compatibility.rst`;
77
+ update that page when a new environment has actually passed.
78
+
79
+ # Releases
80
+
81
+ One-time PyPI setup must be completed by the PyPI account owner. Register a
82
+ [pending trusted publisher](https://pypi.org/manage/account/publishing/) with:
83
+
84
+ | Field | Value |
85
+ | --- | --- |
86
+ | PyPI project name | `sphinx-java-autodoc` |
87
+ | GitHub owner | `r4sky0` |
88
+ | Repository | `sphinx-java-autodoc` |
89
+ | Workflow filename | `release.yml` |
90
+ | Environment | `pypi` |
91
+
92
+ The GitHub repository and the Python distribution share the name
93
+ `sphinx-java-autodoc`. If the project already exists on PyPI, add the publisher in that project's Publishing settings instead. No PyPI
94
+ API token or repository deploy key is needed. See the
95
+ [PyPI trusted publisher documentation](https://docs.pypi.org/trusted-publishers/adding-a-publisher/).
96
+
97
+ Releases are prepared by [Release Please](https://github.com/googleapis/release-please).
98
+ On every push to `main`, it opens or updates a release PR from the conventional
99
+ commits since the last release. That PR bumps `[project].version` in
100
+ `pyproject.toml`, `VERSION` in `src/sphinx_java_autodoc/extractor.py` and the
101
+ project entry in `uv.lock`, and updates `CHANGELOG.md`. Before 1.0, `feat:` and
102
+ breaking changes bump the minor version and everything else the patch version.
103
+ Add a `Release-As: 0.3.0` footer to a commit to choose the version explicitly.
104
+
105
+ To release, review and merge the release PR once `All checks` passes. Release
106
+ Please then tags the merge commit, drafts a GitHub release with the changelog and
107
+ dispatches the Release workflow for that tag. PRs and tags created with the
108
+ default `GITHUB_TOKEN` don't trigger workflows by themselves, so Release Please
109
+ also dispatches CI for its release PR.
110
+
111
+ The Release workflow rejects branches, tags that disagree with either version,
112
+ and commits outside `main`. It reruns CI on the tagged commit, publishes the
113
+ tested wheel and sdist using PyPI OIDC with attestations, then attaches them to
114
+ the draft release and publishes it. Published versions are immutable; fix a bad
115
+ release with a new version. A tag pushed by hand, for example `v0.1.0`, still
116
+ runs the same workflow and creates a release with generated notes.
117
+
118
+ To retry a failed release, rerun failed jobs in GitHub Actions. If publishing has
119
+ not succeeded, you can also dispatch Release manually and select the existing
120
+ tag. Dispatching against a branch deliberately fails validation.
121
+
122
+ GitHub Pages uses the built documentation artifact from a successful `main` push.
123
+ Each open same-repository PR is also published at `pr-preview/pr-<number>/`
124
+ after its CI passes, with a link commented on the PR; fork PRs are not deployed. GitHub environments restrict
125
+ Pages to `main` and PyPI publishing to `v*` tags.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 sphinx-java-autodoc 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.
@@ -0,0 +1,109 @@
1
+ Metadata-Version: 2.5
2
+ Name: sphinx-java-autodoc
3
+ Version: 0.2.0
4
+ Summary: Compiler-backed Java API documentation in native Sphinx nodes
5
+ Project-URL: Documentation, https://r4sky0.github.io/sphinx-java-autodoc/
6
+ Project-URL: Repository, https://github.com/r4sky0/sphinx-java-autodoc
7
+ Project-URL: Issues, https://github.com/r4sky0/sphinx-java-autodoc/issues
8
+ Project-URL: Changelog, https://github.com/r4sky0/sphinx-java-autodoc/releases
9
+ Author: Ralph Offinger
10
+ License-Expression: MIT
11
+ License-File: LICENSE
12
+ Keywords: autodoc,documentation,java,javadoc,sphinx
13
+ Classifier: Development Status :: 3 - Alpha
14
+ Classifier: Framework :: Sphinx :: Extension
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Programming Language :: Java
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 :: Sphinx
23
+ Requires-Python: >=3.12
24
+ Requires-Dist: sphinx<9.2,>=9.1
25
+ Provides-Extra: test
26
+ Requires-Dist: build>=1; extra == 'test'
27
+ Requires-Dist: playwright>=1.50; extra == 'test'
28
+ Requires-Dist: pytest>=8; extra == 'test'
29
+ Description-Content-Type: text/markdown
30
+
31
+ # sphinx-java-autodoc
32
+
33
+ [![CI](https://github.com/r4sky0/sphinx-java-autodoc/actions/workflows/ci.yml/badge.svg)](https://github.com/r4sky0/sphinx-java-autodoc/actions/workflows/ci.yml)
34
+ [Documentation](https://r4sky0.github.io/sphinx-java-autodoc/)
35
+
36
+ Publish your Java library's guides and API reference in one searchable Sphinx
37
+ site. Keep API contracts in Java sources and Javadoc; write guides that help
38
+ your users choose an API and complete a task.
39
+
40
+ `sphinx-java-autodoc` reads Java sources and Javadoc comments with the JDK compiler
41
+ APIs and renders them as native Sphinx content:
42
+
43
+ - Generated, searchable pages for classes, interfaces, enums, records, annotation
44
+ types and nested types.
45
+ - Signatures, overloads, Javadoc links and inherited method documentation.
46
+ - Class excerpts in handwritten guides, and links between projects through intersphinx.
47
+ - Pages that refresh when sources change, with content-based extraction caching.
48
+
49
+ Extraction never executes application classes or annotation processors, and never
50
+ downloads Java dependencies. See the [Apache Commons Lang example](https://r4sky0.github.io/sphinx-java-autodoc/showcase/commons-lang/furo/)
51
+ for what the output looks like.
52
+
53
+ ## Requirements
54
+
55
+ Python 3.12+, Sphinx 9.1.x, and **JDK 25 for extraction**. Your library can keep
56
+ targeting Java 17 or 21. See [compatibility and limits](https://r4sky0.github.io/sphinx-java-autodoc/compatibility.html)
57
+ for the tested versions.
58
+
59
+ ## Quick start
60
+
61
+ ```sh
62
+ uv add "sphinx-java-autodoc @ git+https://github.com/r4sky0/sphinx-java-autodoc.git"
63
+ ```
64
+
65
+ In `docs/conf.py`:
66
+
67
+ ```python
68
+ extensions = ["sphinx_java_autodoc"]
69
+ java_sources = ["../src/main/java"]
70
+ java_release = "17"
71
+ java_generate = "api"
72
+ java_visibility = "public"
73
+ ```
74
+
75
+ Add `api/index` to the toctree in `docs/index.rst`, then build:
76
+
77
+ ```sh
78
+ uv run sphinx-build -W --keep-going -n docs docs/_build/html
79
+ ```
80
+
81
+ [Publish your first API pages](https://r4sky0.github.io/sphinx-java-autodoc/getting-started.html) walks through these steps.
82
+ Then continue with:
83
+
84
+ - [Write a guide your users can follow](https://r4sky0.github.io/sphinx-java-autodoc/guide.html)
85
+ - [Build with dependencies and CI](https://r4sky0.github.io/sphinx-java-autodoc/build-integration.html): Maven/Gradle
86
+ classpaths, pre-extracted models and publishing to GitHub Pages
87
+ - [Configuration and reference](https://r4sky0.github.io/sphinx-java-autodoc/usage.html) and [supported Javadoc](https://r4sky0.github.io/sphinx-java-autodoc/javadoc-support.html)
88
+ - [Troubleshooting](https://r4sky0.github.io/sphinx-java-autodoc/troubleshooting.html)
89
+ - [How it works](https://r4sky0.github.io/sphinx-java-autodoc/design.html) and the [architecture decision](docs/adr/0001-jdk-doclet-xml-sphinx-domain.md)
90
+
91
+ ## Development
92
+
93
+ From a clone of this repository:
94
+
95
+ ```sh
96
+ uv sync --locked
97
+ uv run --locked pre-commit install
98
+ uv run --locked pre-commit run --all-files
99
+ uv run --locked pytest
100
+ uv run --locked --group showcase python showcase/build.py
101
+ uv run --locked sphinx-build -W --keep-going -n docs docs/_build/html
102
+ ```
103
+
104
+ Development and releases are documented in [CONTRIBUTING.md](CONTRIBUTING.md).
105
+ CI covers lint, compiler warnings, integration tests, built distributions,
106
+ dependency vulnerabilities, six HTML themes, the text builder, and Chromium
107
+ browser interactions.
108
+
109
+ [MIT licensed](LICENSE).
@@ -0,0 +1,79 @@
1
+ # sphinx-java-autodoc
2
+
3
+ [![CI](https://github.com/r4sky0/sphinx-java-autodoc/actions/workflows/ci.yml/badge.svg)](https://github.com/r4sky0/sphinx-java-autodoc/actions/workflows/ci.yml)
4
+ [Documentation](https://r4sky0.github.io/sphinx-java-autodoc/)
5
+
6
+ Publish your Java library's guides and API reference in one searchable Sphinx
7
+ site. Keep API contracts in Java sources and Javadoc; write guides that help
8
+ your users choose an API and complete a task.
9
+
10
+ `sphinx-java-autodoc` reads Java sources and Javadoc comments with the JDK compiler
11
+ APIs and renders them as native Sphinx content:
12
+
13
+ - Generated, searchable pages for classes, interfaces, enums, records, annotation
14
+ types and nested types.
15
+ - Signatures, overloads, Javadoc links and inherited method documentation.
16
+ - Class excerpts in handwritten guides, and links between projects through intersphinx.
17
+ - Pages that refresh when sources change, with content-based extraction caching.
18
+
19
+ Extraction never executes application classes or annotation processors, and never
20
+ downloads Java dependencies. See the [Apache Commons Lang example](https://r4sky0.github.io/sphinx-java-autodoc/showcase/commons-lang/furo/)
21
+ for what the output looks like.
22
+
23
+ ## Requirements
24
+
25
+ Python 3.12+, Sphinx 9.1.x, and **JDK 25 for extraction**. Your library can keep
26
+ targeting Java 17 or 21. See [compatibility and limits](https://r4sky0.github.io/sphinx-java-autodoc/compatibility.html)
27
+ for the tested versions.
28
+
29
+ ## Quick start
30
+
31
+ ```sh
32
+ uv add "sphinx-java-autodoc @ git+https://github.com/r4sky0/sphinx-java-autodoc.git"
33
+ ```
34
+
35
+ In `docs/conf.py`:
36
+
37
+ ```python
38
+ extensions = ["sphinx_java_autodoc"]
39
+ java_sources = ["../src/main/java"]
40
+ java_release = "17"
41
+ java_generate = "api"
42
+ java_visibility = "public"
43
+ ```
44
+
45
+ Add `api/index` to the toctree in `docs/index.rst`, then build:
46
+
47
+ ```sh
48
+ uv run sphinx-build -W --keep-going -n docs docs/_build/html
49
+ ```
50
+
51
+ [Publish your first API pages](https://r4sky0.github.io/sphinx-java-autodoc/getting-started.html) walks through these steps.
52
+ Then continue with:
53
+
54
+ - [Write a guide your users can follow](https://r4sky0.github.io/sphinx-java-autodoc/guide.html)
55
+ - [Build with dependencies and CI](https://r4sky0.github.io/sphinx-java-autodoc/build-integration.html): Maven/Gradle
56
+ classpaths, pre-extracted models and publishing to GitHub Pages
57
+ - [Configuration and reference](https://r4sky0.github.io/sphinx-java-autodoc/usage.html) and [supported Javadoc](https://r4sky0.github.io/sphinx-java-autodoc/javadoc-support.html)
58
+ - [Troubleshooting](https://r4sky0.github.io/sphinx-java-autodoc/troubleshooting.html)
59
+ - [How it works](https://r4sky0.github.io/sphinx-java-autodoc/design.html) and the [architecture decision](docs/adr/0001-jdk-doclet-xml-sphinx-domain.md)
60
+
61
+ ## Development
62
+
63
+ From a clone of this repository:
64
+
65
+ ```sh
66
+ uv sync --locked
67
+ uv run --locked pre-commit install
68
+ uv run --locked pre-commit run --all-files
69
+ uv run --locked pytest
70
+ uv run --locked --group showcase python showcase/build.py
71
+ uv run --locked sphinx-build -W --keep-going -n docs docs/_build/html
72
+ ```
73
+
74
+ Development and releases are documented in [CONTRIBUTING.md](CONTRIBUTING.md).
75
+ CI covers lint, compiler warnings, integration tests, built distributions,
76
+ dependency vulnerabilities, six HTML themes, the text builder, and Chromium
77
+ browser interactions.
78
+
79
+ [MIT licensed](LICENSE).
@@ -0,0 +1,10 @@
1
+ # Security
2
+
3
+ Security fixes target the latest published version. Until the first publication,
4
+ use the latest `main` commit and review the known limits in
5
+ `docs/compatibility.rst`.
6
+
7
+ Report vulnerabilities privately through
8
+ [GitHub security reporting](https://github.com/r4sky0/sphinx-java-autodoc/security/advisories/new).
9
+ Include a minimal reproducer, the affected version, and Python/JDK versions.
10
+ Please keep exploit details out of public issues while a fix is being prepared.
@@ -0,0 +1,71 @@
1
+ # ADR 001: JDK doclet, versioned XML, native Sphinx domain
2
+
3
+ Accepted 2026-10-10 after a doclet prototype; research date 2026-10-10.
4
+
5
+ Use the supported `jdk.javadoc.doclet` and compiler model APIs to inspect source
6
+ without loading application classes. The compiler resolves signatures, imports,
7
+ overloads, type erasure, and overrides. Comment inheritance is a separate doclet
8
+ responsibility: a doclet receives an unexpanded `INHERIT_DOC` node and can locate
9
+ the overridden generic method using `Elements.overrides`. There is no supported
10
+ call that returns the standard doclet's fully inherited documentation, and ancestor
11
+ comments are only available when the ancestor's source is supplied.
12
+
13
+ Use XML schema version 1 across the process boundary. The JDK includes DOM/XML
14
+ serialization and Python includes ElementTree. JSON is equally capable but would
15
+ require a Java JSON library or our own JSON serializer. XML preserves ordered
16
+ comment tokens without re-parsing Javadoc strings; semantic reference targets
17
+ travel alongside their presentation labels. Neither format supplies semantics
18
+ on its own. No upstream implementation is copied.
19
+
20
+ Render native docutils paragraphs, lists, literal blocks, Sphinx descriptions,
21
+ and pending cross-references. A `java` domain owns inventories and resolution.
22
+ Only page skeletons (titles, toctrees, directives) use generated reStructuredText;
23
+ source comments are never interpreted as reStructuredText or embedded raw HTML.
24
+
25
+ Run extraction once before Sphinx reads documents. Hash source and dependency
26
+ contents, options, JDK identity and extractor code. Cache complete immutable XML
27
+ snapshots and atomically replace files. A changed model invalidates consuming
28
+ documents even if filesystem timestamps do not change. This intentionally uses
29
+ whole-project extraction rather than fragile per-file semantic invalidation.
30
+
31
+ The initial runtime baseline is JDK 25. Traditional Javadoc and the JDK 25
32
+ automatic inheritance search are supported; snippet expansion and Markdown
33
+ comments initially produced diagnostics (plain inline snippets were added later). This avoids promising old-JDK
34
+ compatibility without running old JDKs. See the validation report for tested
35
+ Python/Sphinx versions and exact boundaries.
36
+
37
+ Tradeoffs: a JDK and a resolvable compile classpath are required; we own a compact
38
+ doc-comment-to-node mapping and inheritance implementation.
39
+
40
+ ## Alternatives considered
41
+
42
+ Assessed from official documentation and source inspection; only the selected
43
+ backend was prototyped. Other tools' runtime behavior and speed were not measured.
44
+
45
+ - **[Manticore XMLDoclet](https://github.com/manticore-projects/xml-doclet) +
46
+ [sphinx-javadoc-xml](https://github.com/manticore-projects/sphinx-javadoc-xml):**
47
+ rich declaration metadata, but `Parser.getJavaDoc` stringifies comment bodies, the
48
+ schema has no resolved inline-link targets or record components, and the renderer
49
+ removes `inheritDoc` and registers directives without a Java domain.
50
+ - **Doxygen with [Breathe](https://github.com/breathe-doc/breathe) or
51
+ [Doxysphinx](https://github.com/boschglobal/doxysphinx):** Doxygen's Java dialect
52
+ is not the JDK documentation model, Breathe's domains target C/C++, and Doxysphinx
53
+ wraps Doxygen HTML in raw directives instead of native Java objects.
54
+ - **[JavaParser](https://github.com/javaparser/javaparser),
55
+ [Eclipse JDT](https://github.com/eclipse-jdt/eclipse.jdt.core),
56
+ [tree-sitter-java](https://github.com/tree-sitter/tree-sitter-java):** a second
57
+ parser to configure and maintain, with our own type resolution (or none, for
58
+ tree-sitter) and still our own inheritance and rendering.
59
+ - **Reflection or bytecode:** no source comments, and loading classes can run
60
+ static initializers.
61
+ - **Parsing generated Javadoc HTML:** presentation markup is an unstable
62
+ interchange format and semantic identities would have to be reconstructed.
63
+
64
+ From the Sphinx side, [sphinx-autoapi](https://github.com/readthedocs/sphinx-autoapi)
65
+ informed page generation at `builder-inited`,
66
+ [sphinx-autodoc2](https://github.com/sphinx-extensions2/sphinx-autodoc2) the
67
+ separation of analysis and rendering with content-hash caching, and
68
+ [sphinx-js](https://github.com/pyodide/sphinx-js) the structured process boundary.
69
+ The archived [javasphinx](https://github.com/bronto/javasphinx) issues (inheritDoc,
70
+ default methods, encoding, parallel builds) motivated compiler-backed parsing,
71
+ explicit diagnostics, content fingerprints and domain merge tests. No code was copied.
@@ -0,0 +1,51 @@
1
+ # Domain Docs
2
+
3
+ How the engineering skills should consume this repo's domain documentation when exploring the codebase.
4
+
5
+ ## Before exploring, read these
6
+
7
+ - **`CONTEXT.md`** at the repo root, or
8
+ - **`CONTEXT-MAP.md`** at the repo root if it exists: it points at one `CONTEXT.md` per context. Read each one relevant to the topic.
9
+ - **`docs/adr/`**: read ADRs that touch the area you're about to work in. In multi-context repos, also check `src/<context>/docs/adr/` for context-scoped decisions.
10
+
11
+ If any of these files don't exist, **proceed silently**. Don't flag their absence; don't suggest creating them upfront. The `/domain-modeling` skill (reached via `/grill-with-docs` and `/improve-codebase-architecture`) creates them lazily when terms or decisions actually get resolved.
12
+
13
+ ## File structure
14
+
15
+ Single-context repo (most repos):
16
+
17
+ ```
18
+ /
19
+ ├── CONTEXT.md
20
+ ├── docs/adr/
21
+ │ ├── 0001-event-sourced-orders.md
22
+ │ └── 0002-postgres-for-write-model.md
23
+ └── src/
24
+ ```
25
+
26
+ Multi-context repo (presence of `CONTEXT-MAP.md` at the root):
27
+
28
+ ```
29
+ /
30
+ ├── CONTEXT-MAP.md
31
+ ├── docs/adr/ ← system-wide decisions
32
+ └── src/
33
+ ├── ordering/
34
+ │ ├── CONTEXT.md
35
+ │ └── docs/adr/ ← context-specific decisions
36
+ └── billing/
37
+ ├── CONTEXT.md
38
+ └── docs/adr/
39
+ ```
40
+
41
+ ## Use the glossary's vocabulary
42
+
43
+ When your output names a domain concept (in an issue title, a refactor proposal, a hypothesis, a test name), use the term as defined in `CONTEXT.md`. Don't drift to synonyms the glossary explicitly avoids.
44
+
45
+ If the concept you need isn't in the glossary yet, that's a signal: either you're inventing language the project doesn't use (reconsider) or there's a real gap (note it for `/domain-modeling`).
46
+
47
+ ## Flag ADR conflicts
48
+
49
+ If your output contradicts an existing ADR, surface it explicitly rather than silently overriding:
50
+
51
+ > _Contradicts ADR-0007 (event-sourced orders), but worth reopening because…_
@@ -0,0 +1,45 @@
1
+ # Issue tracker: GitHub
2
+
3
+ Issues and specs for this repo live as GitHub issues. Use the `gh` CLI for all operations.
4
+
5
+ ## Conventions
6
+
7
+ - **Create an issue**: `gh issue create --title "..." --body "..."`. Use a heredoc for multi-line bodies.
8
+ - **Read an issue**: `gh issue view <number> --comments`, filtering comments by `jq` and also fetching labels.
9
+ - **List issues**: `gh issue list --state open --json number,title,body,labels,comments --jq '[.[] | {number, title, body, labels: [.labels[].name], comments: [.comments[].body]}]'` with appropriate `--label` and `--state` filters.
10
+ - **Comment on an issue**: `gh issue comment <number> --body "..."`
11
+ - **Apply / remove labels**: `gh issue edit <number> --add-label "..."` / `--remove-label "..."`
12
+ - **Close**: `gh issue close <number> --comment "..."`
13
+
14
+ Infer the repo from `git remote -v`; `gh` does this automatically when run inside a clone.
15
+
16
+ ## Pull requests as a triage surface
17
+
18
+ **PRs as a request surface: no.** _(Set to `yes` if this repo treats external PRs as feature requests; `/triage` reads this flag.)_
19
+
20
+ When set to `yes`, PRs run through the same labels and states as issues, using the `gh pr` equivalents:
21
+
22
+ - **Read a PR**: `gh pr view <number> --comments` and `gh pr diff <number>` for the diff.
23
+ - **List external PRs for triage**: `gh pr list --state open --json number,title,body,labels,author,authorAssociation,comments` then keep only `authorAssociation` of `CONTRIBUTOR`, `FIRST_TIME_CONTRIBUTOR`, or `NONE` (drop `OWNER`/`MEMBER`/`COLLABORATOR`).
24
+ - **Comment / label / close**: `gh pr comment`, `gh pr edit --add-label`/`--remove-label`, `gh pr close`.
25
+
26
+ GitHub shares one number space across issues and PRs, so a bare `#42` may be either: resolve with `gh pr view 42` and fall back to `gh issue view 42`.
27
+
28
+ ## When a skill says "publish to the issue tracker"
29
+
30
+ Create a GitHub issue.
31
+
32
+ ## When a skill says "fetch the relevant ticket"
33
+
34
+ Run `gh issue view <number> --comments`.
35
+
36
+ ## Wayfinding operations
37
+
38
+ Used by `/wayfinder`. The **map** is a single issue with **child** issues as tickets.
39
+
40
+ - **Map**: a single issue labelled `wayfinder:map`, holding the Notes / Decisions-so-far / Fog body. `gh issue create --label wayfinder:map`.
41
+ - **Child ticket**: an issue linked to the map as a GitHub sub-issue (`gh api` on the sub-issues endpoint). Where sub-issues aren't enabled, add the child to a task list in the map body and put `Part of #<map>` at the top of the child body. Labels: `wayfinder:<type>` (`research`/`prototype`/`grilling`/`task`). Once claimed, the ticket is assigned to the driving dev.
42
+ - **Blocking**: GitHub's **native issue dependencies**, the canonical, UI-visible representation. Add an edge with `gh api --method POST repos/<owner>/<repo>/issues/<child>/dependencies/blocked_by -F issue_id=<blocker-db-id>`, where `<blocker-db-id>` is the blocker's numeric **database id** (`gh api repos/<owner>/<repo>/issues/<n> --jq .id`, _not_ the `#number` or `node_id`). GitHub reports `issue_dependencies_summary.blocked_by` (open blockers only, the live gate). Where dependencies aren't available, fall back to a `Blocked by: #<n>, #<n>` line at the top of the child body. A ticket is unblocked when every blocker is closed.
43
+ - **Frontier query**: list the map's open children (`gh issue list --state open`, scoped to the map's sub-issues / task list), drop any with an open blocker (`issue_dependencies_summary.blocked_by > 0`, or an open issue in the `Blocked by` line) or an assignee; first in map order wins.
44
+ - **Claim**: `gh issue edit <n> --add-assignee @me`, the session's first write.
45
+ - **Resolve**: `gh issue comment <n> --body "<answer>"`, then `gh issue close <n>`, then append a context pointer (gist + link) to the map's Decisions-so-far.
@@ -0,0 +1,108 @@
1
+ Choosing a tool
2
+ ===============
3
+
4
+ Several tools put Java API documentation into Sphinx, and a plain Javadoc site is
5
+ always an option. This page shows how they compare so you can pick the one that
6
+ fits your project, even if that isn't this extension.
7
+
8
+ The other tools were assessed in October 2026 by reading their documentation and
9
+ source code, not by running them. If something here is out of date, please
10
+ `open an issue <https://github.com/r4sky0/sphinx-java-autodoc/issues>`_.
11
+
12
+ At a glance
13
+ -----------
14
+
15
+ .. list-table::
16
+ :header-rows: 1
17
+ :stub-columns: 1
18
+ :widths: 20 20 20 20 20
19
+
20
+ * -
21
+ - sphinx-java-autodoc
22
+ - `sphinx-javadoc-xml <https://github.com/manticore-projects/sphinx-javadoc-xml>`_
23
+ - `javasphinx <https://github.com/bronto/javasphinx>`_
24
+ - Doxygen + `Breathe <https://github.com/breathe-doc/breathe>`_ / `Exhale <https://github.com/svenevs/exhale>`_
25
+ * - Maintained
26
+ - Yes
27
+ - Yes
28
+ - No, archived in 2019
29
+ - Yes
30
+ * - Reads your Java with
31
+ - The JDK's own ``javadoc`` tool
32
+ - A third-party XML doclet you run in Maven or Gradle
33
+ - ``javalang``, a Python parser for Java 8 syntax
34
+ - Doxygen's own parser
35
+ * - Modern Java (records, sealed types, modules)
36
+ - Whatever JDK 25 accepts
37
+ - Limited to what the XML doclet records; no record components
38
+ - No
39
+ - Partial
40
+ * - ``{@link}`` in comments
41
+ - Clickable link to the resolved target
42
+ - Shown as code, not linked
43
+ - Linked by name, resolved by Sphinx
44
+ - Linked by Doxygen's resolver
45
+ * - ``{@inheritDoc}``
46
+ - Resolved; a warning if it can't be
47
+ - Removed
48
+ - Not supported
49
+ - Handled by Doxygen
50
+ * - Comment rendering
51
+ - Native Sphinx nodes
52
+ - Converted to reStructuredText text
53
+ - HTML converted to reStructuredText text
54
+ - Breathe: native nodes; Doxysphinx: Doxygen HTML
55
+ * - Java roles for your own pages (``:java:type:``)
56
+ - Yes
57
+ - No
58
+ - Yes
59
+ - No, only the C++ domain
60
+ * - Intersphinx inventory for other sites
61
+ - Yes
62
+ - No
63
+ - Yes
64
+ - C++ objects only
65
+ * - Look
66
+ - Follows your Sphinx theme
67
+ - Own Javadoc-style CSS; loads web fonts from a CDN by default
68
+ - Follows your Sphinx theme
69
+ - Follows your Sphinx theme
70
+ * - API pages
71
+ - Generated during the Sphinx build
72
+ - One directive per API, package or class in your pages
73
+ - Generated by a separate command; you commit the files
74
+ - One directive per class, or generated by Exhale
75
+ * - Needs at docs build time
76
+ - JDK 25, or no JDK with a :doc:`pre-extracted model <build-integration>`
77
+ - Only the XML file
78
+ - Only Python
79
+ - The ``doxygen`` program
80
+
81
+ When to choose which
82
+ --------------------
83
+
84
+ **sphinx-java-autodoc** fits when you want guides and the API reference in one
85
+ Sphinx site, with links that resolve and inherited documentation that stays in
86
+ place. You need JDK 25 to extract, although your library can target Java 17 or
87
+ 21. See :doc:`compatibility` for tested versions and known limits.
88
+
89
+ **sphinx-javadoc-xml** fits when you already produce XML doclet output in your
90
+ build and want a page that looks like classic Javadoc, and missing ``{@link}``
91
+ targets and inherited comments don't matter for your API.
92
+
93
+ **javasphinx** isn't a good choice for new projects. Its own README says it should
94
+ be used for historical purposes only, and it can't parse Java newer than 8.
95
+ Several forks exist, but none is released under a new name.
96
+
97
+ **Doxygen with Breathe or Exhale** fits when one site documents C or C++ next to
98
+ Java and you already run Doxygen. Its Java support is secondary, and Java objects
99
+ appear as C++ ones in Sphinx.
100
+
101
+ **A separate Javadoc site** fits when your readers expect the standard Javadoc
102
+ layout and your guides can live elsewhere. Sphinx pages can link to it with
103
+ `sphinx.ext.extlinks <https://www.sphinx-doc.org/en/master/usage/extensions/extlinks.html>`_.
104
+ `sphinx-javalink <https://github.com/bluekeyes/sphinx-javalink>`_ did this with
105
+ Java-aware roles but hasn't changed since 2016.
106
+
107
+ The :doc:`design notes <design>` explain why this extension uses the JDK instead
108
+ of these approaches.