Skip to content

fix(docs): correct SVG diagram links and restore sidebar version string#1082

Merged
lord-haffi merged 2 commits into
mainfrom
fix/docs-svg-links-and-version-string
Jul 2, 2026
Merged

fix(docs): correct SVG diagram links and restore sidebar version string#1082
lord-haffi merged 2 commits into
mainfrom
fix/docs-svg-links-and-version-string

Conversation

@lord-haffi

Copy link
Copy Markdown
Collaborator

Fixes two independent regressions in the published API docs.

1. Broken links inside the class-diagram SVGs

The graph link template was .../api/{module}.html. bo4e-cli's {module}
placeholder expands to the schema-derived path (com.Angebotsteil), producing
api/com.Angebotsteil.html — a 404. Sphinx groups modules into per-package
pages, so the real target is api/bo4e.com.html#bo4e.com.angebotsteil.Angebotsteil.

The template is rebuilt as:

api/bo4e.{pkg}.html#bo4e.{pkg}.{class.lower}.{class}

using the new {class.lower} accessor (see the CLI PR below). Verified: the
rendered SVG hrefs return 200 with the anchor present on the live docs.

Verified convention: all 194 exported BO4E classes on main satisfy
module_file == ClassName.lower(), so {class.lower} reproduces the Sphinx
module segment exactly.

2. Missing version string in the sidebar

Not a version-setting bug — version/release are still correct (the page
title shows the version). The sphinx-rtd-theme 3.0.2 → 3.1.0 bump (#1069)
removed the always-on <div class="version">, showing it only via the Read the
Docs flyout (READTHEDOCS or DEBUG). On GitHub Pages that gate is never true.

Restored with a docs/_templates/layout.html override of the theme's
sidebartitle block (templates_path was already configured). Verified with an
isolated Sphinx build rendering <div class="version">…</div>.

⚠️ Release ordering

The setup-bo4e pin is bumped to v1.2.4, which must carry the
{class.lower} accessor from bo4e/BO4E-CLI#196. That CLI release has to ship
first; until then this branch's docs CI cannot download the pinned binary. Adjust
the pin if the actual CLI release tag differs.

🤖 Generated with Claude Code

lord-haffi and others added 2 commits July 1, 2026 12:38
Two independent regressions in the published API docs:

1. Broken links inside the class-diagram SVGs. The graph link template was
   `.../api/{module}.html`, and bo4e-cli's `{module}` placeholder expands to
   the schema-derived path (`com.Angebotsteil`), producing
   `api/com.Angebotsteil.html` -- a 404. Sphinx groups modules into
   per-package pages, so the correct target is
   `api/bo4e.com.html#bo4e.com.angebotsteil.Angebotsteil`. Rebuild the
   template as `api/bo4e.{pkg}.html#bo4e.{pkg}.{class.lower}.{class}` using
   the new `{class.lower}` accessor (bo4e-cli >= v1.2.4), and bump the
   setup-bo4e pin accordingly.

2. Missing version string in the sidebar. sphinx-rtd-theme 3.1.0 dropped the
   always-on `<div class="version">` (now shown only via the Read the Docs
   flyout), so on GitHub Pages the version vanished. Restore it with a
   `docs/_templates/layout.html` override of the theme's `sidebartitle` block.
   `version` itself was already set correctly in conf.py.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…inks

Switch the graph link template to bo4e-cli's new `{namespace}` placeholder and
the Sphinx module anchor:

    …/api/{namespace}.html#module-{namespace}.{class.lower}

`{namespace}` is `bo4e` + the module's parent package, so one template resolves
both nested classes (`bo4e.bo.html#module-bo4e.bo.angebot`) and root-level ones
(`bo4e.html#module-bo4e.zusatzattribut`). The previous `bo4e.{pkg}.…` form
mis-linked the root-level ZusatzAttribut schema (its `{pkg}` is the class name,
not a package). All targets verified 200-with-anchor on the live docs.

Requires bo4e-cli >= v1.2.4 (already the setup-bo4e pin).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@lord-haffi lord-haffi merged commit e33f108 into main Jul 2, 2026
29 of 30 checks passed
@lord-haffi lord-haffi deleted the fix/docs-svg-links-and-version-string branch July 2, 2026 07:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant