Skip to content

fix: stop linking to source when source.enabled is false - #404

Merged
has2k1 merged 4 commits into
mainfrom
constants-separators
Oct 22, 2026
Merged

has2k1 merged 4 commits into
mainfrom
constants-separators

Conversation

@has2k1

@has2k1 has2k1 commented Oct 22, 2026

Copy link
Copy Markdown
Collaborator

This PR makes source.enabled: false remove the "Source" links from API reference pages again. Since the current renderer became the default, it linked to GitHub whenever the project had a repository URL, so sites that had turned source links off still showed them.

It also retires the last pieces of the old post-render pipeline that the renderer has made redundant. The build no longer writes _source_links.json, _object_types.json or _constant_values.json, and the "Generate source links" step is gone from the build log. The rules between class and module members are drawn by the stylesheet instead of being inserted into the HTML, and they now also appear between the members of a nested class. Otherwise the rendered pages are unchanged.

Constant reference pages already show `NAME: annotation = value` straight
from the renderer. The post-render step that tried to add the same line
looked for a bare-name paragraph the renderer no longer produces, so it
never changed a page.

Remove that step along with the metadata it read: the build no longer
extracts constant values or writes `_constant_values.json`, and the
post-render script no longer loads `_object_types.json`, which only that
step used. The rendered reference pages are unchanged.
Class and module reference pages separate inline members with a solid
rule after the summary table and a dotted rule between members. These
rules were inserted into the HTML after rendering; the stylesheet now
draws them instead, with the same colours, opacity and spacing, so the
pages look the same in light and dark mode.

The rules now also appear between the members of a nested class, which
the old insertion skipped. A stylesheet rule for member indentation that
never matched any rendered element is removed.
The renderer builds source links and inventory roles straight from the
package, so two files the build wrote for the old post-render script
had no remaining reader: the source-link map, and the object-type map
whose only use was the build-time estimate. Stop writing both, and drop
the "Generate source links" step from the build log.

The build-time estimate now counts the entries in the previous build's
`objects.inv` instead. Like before, it reflects the last build, because
the estimate is printed before this build resolves the package.
API reference pages showed "Source" links to GitHub whenever the project
had a repository URL, even with `source.enabled: false`. The renderer
links to source only when it knows the repository URL, so the build now
withholds that URL when source links are disabled.
@github-actions

Copy link
Copy Markdown

📚 Preview this PR's docs locally

Fetch the just-built site and open it in your browser:

# this exact build
great-docs preview --run 39773127438

# or always the latest build for this PR
great-docs preview --pr 404
Auth & tips
  • Requires great-docs: pip install great-docs (or run via pipx/uvx).
  • Auth: run gh auth login then add --use-gh, or set GITHUB_TOKEN (needs Actions: read).
  • Jump to a page: add --path reference/index.html.
  • Latest vs exact: --pr <n> grabs the newest build; --run <id> pins this one.
  • Re-download: --refresh ignores the local cache.

@has2k1
has2k1 merged commit 4f55320 into main Oct 22, 2026
8 checks passed
@has2k1
has2k1 deleted the constants-separators branch October 22, 2026 12:02
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