Skip to main content

sphinx-javadoc-xml

PyPI Python License

A Sphinx extension that renders Java API documentation from an XML doclet output in a JavaDoc-inspired style — fully integrated with your Sphinx theme, with cross-links to OpenJDK Javadoc and between all defined types.

Features

  • Full XML doclet support: classes, interfaces, enums, methods, fields, constructors, annotations, type parameters, bounded wildcards, exceptions
  • OpenJDK cross-links: java.util.List becomes a clickable link to the Oracle JDK 21 docs (configurable URL)
  • Internal cross-references: all types defined in your API link to each other
  • Package name stripping: types within the same package show short names
  • Three directives: full API, single class, or package summary
  • Theme-compatible CSS: works with Furo, Read the Docs, Alabaster, and others

Installation

pip install sphinx-javadoc-xml

Quick Start

1. Enable in conf.py

extensions = [
    "sphinx_javadoc_xml",
]

# Optional configuration
javadoc_jdk_url = "https://docs.oracle.com/en/java/javase/21/docs/api"
javadoc_load_fonts = True    # Load Roboto fonts from Google Fonts CDN
javadoc_load_bulma = False   # Load Bulma CSS from CDN (for non-Bulma themes)

With manticore-sphinx-theme

When using manticore-sphinx-theme, the extension automatically inherits the Manticore color scheme (--bst-* CSS variables), Roboto fonts, and Bulma CSS from the theme — no extra configuration needed:

html_theme = "manticore_sphinx_theme"
extensions = ["sphinx_javadoc_xml"]
# Fonts and Bulma are auto-detected and skipped (already provided by theme)

With other themes

The extension ships with the Manticore color scheme as defaults and loads Google Fonts (Roboto family) automatically. Optionally enable Bulma for enhanced table rendering:

html_theme = "furo"  # or alabaster, sphinx_rtd_theme, etc.
extensions = ["sphinx_javadoc_xml"]
javadoc_load_bulma = True  # Optional: pull Bulma from CDN

2. Place your XML file

docs/
├── _static/
│   └── api.xml
├── conf.py
└── api.rst

3. Use the directives

Full package API:

.. javadoc-api:: _static/api.xml
   :package: net.sf.jsqlparser.expression
   :public-only:

Single class:

.. javadoc-class:: _static/api.xml
   :class: net.sf.jsqlparser.expression.Function
   :public-only:

Package summary only (no type details):

.. javadoc-package:: _static/api.xml
   :package: net.sf.jsqlparser.statement.select
   :public-only:

Directives Reference

.. javadoc-api:: <path>

Option Description
:package: Filter to a specific package name
:public-only: Hide private and package-private members
:jdk-url: Override JDK Javadoc base URL for this directive

.. javadoc-class:: <path>

Option Description
:class: Required. Qualified or simple class name
:public-only: Hide private and package-private members
:jdk-url: Override JDK Javadoc base URL for this directive

.. javadoc-package:: <path>

Option Description
:package: Required. Package name to render
:public-only: Hide private and package-private members

Configuration (conf.py)

Option Default Description
javadoc_jdk_url https://docs.oracle.com/en/java/javase/21/docs/api Base URL for JDK Javadoc cross-links
javadoc_load_fonts True Load Google Fonts (Roboto family); auto-disabled under manticore-sphinx-theme
javadoc_load_bulma False Load Bulma CSS from CDN; auto-disabled under manticore-sphinx-theme

Cross-Linking

The extension automatically creates hyperlinks:

  • JDK types → Oracle Javadoc (e.g., java.util.List → docs.oracle.com/...)
  • Internal types → anchor links within the same page or document
  • External links open in a new tab and show a small ↗ indicator

Theme Compatibility

The CSS uses CSS custom properties (--jdx-*) that automatically inherit from manticore-sphinx-theme's --bst-* variables when available:

Theme Integration
manticore-sphinx-theme Native — inherits colors, fonts, Bulma; zero config
Furo Full — uses Manticore defaults, optional Bulma
sphinx_rtd_theme Full — Manticore colors with RTD layout
Alabaster Full — clean integration
sphinx_book_theme Full — Jupyter Book style with Manticore colors

All CSS selectors are prefixed with javadoc- so they never conflict with theme styles.

The extension expects the XML structure produced by the xml-doclet or a compatible custom doclet. See the CHANGELOG for supported elements.

XML Format

The extension expects the XML structure produced by the xml-doclet or a compatible custom doclet. See the CHANGELOG for supported elements.

Publishing to PyPI

# Build
python -m build

# Upload to TestPyPI first
twine upload --repository testpypi dist/*

# Upload to PyPI
twine upload dist/*

Or use GitHub Actions with OIDC trusted publishing.

License

MIT

Release files for sphinx-javadoc-xml 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sphinx-javadoc-xml 0.3.0
File Size Uploaded
sphinx_javadoc_xml-0.3.0.tar.gz 25.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sphinx-javadoc-xml 0.3.0
File Interpreter ABI Platform
sphinx_javadoc_xml-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 50.2 kB

Release files / sphinx_javadoc_xml-0.3.0.tar.gz

Download URL sphinx_javadoc_xml-0.3.0.tar.gz
Size 25.8 kB
Tags Source
SHA-256 checksum
How to use checksums
5e08c06ab625de4931761aec531e956f09b1e1715386029074ce934ebdf1c49c
BLAKE2b-256 checksum
How to use checksums
0ac8303189d51f77321983a7b6df53a5d77b0fa6b9144fdbf7a05e93aabb05df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 18, 2026.

Transparency log

Release files / sphinx_javadoc_xml-0.3.0-py3-none-any.whl

Download URL sphinx_javadoc_xml-0.3.0-py3-none-any.whl
Size 24.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d77de75905d386374f2b496be9de48146733e50d1829754f5b64386f4323b049
BLAKE2b-256 checksum
How to use checksums
dce35f243198e07d1145700109c5faf81a137cfef5d2e2be21a7e2dbe292eded
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 18, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page