Skip to content

docs: add stable anchors and cross-ref ids to guide pages - #555

Merged
ocots merged 1 commit into
mainfrom
docs/guide-anchors
Sep 2, 2026
Merged

ocots merged 1 commit into
mainfrom
docs/guide-anchors

Conversation

@ocots

@ocots ocots commented Sep 2, 2026

Copy link
Copy Markdown
Member

Scope

Add a stable @id guide-<slug> anchor to the H1 of every docs guide page and convert all cross-guide references to the new ids:

  • relative links like [Data](data.md) → [Data](@ref guide-data)
  • bare page-title @refs like [Options System](@ref) → [Options System](@ref guide-options-system)
  • move the @meta block after the H1 on the 7 pages where it preceded the title, to satisfy markdownlint MD041 (first-line-heading).

Motivation

The docs build failed in CI because [Differentiation](@ref) could not be resolved: differentiation.md's heading is Differentiation: AD backend strategies, so there is no anchor named Differentiation. The unresolved @ref renders as a literal ./@ref link, which Vitepress treats as a dead link and aborts the build.

Giving every page a named @id makes such references robust and provides a stable target for external (InterLinks) cross-references.

Verification

julia --project=. docs/make.jl builds cleanly with no Cannot resolve @ref warnings and no dead links.

Closes #554.

Add an `@id guide-<slug>` anchor to every guide page H1 and convert
cross-guide references (both relative `.md` links and bare `@ref`
links) to the new `@ref guide-<slug>` ids.

This fixes a broken `[Differentiation](@ref)` link that produced an
unresolvable `./@ref` dead link and failed the Vitepress docs build in CI.
The ids also give external pages a stable target for cross-referencing.
Move the `@meta` block after the H1 so guide pages satisfy the
markdownlint MD041 (first-line-heading) rule.
@ocots ocots added the run documentation Trigger the Documentation workflow on this PR label Sep 2, 2026
@ocots
ocots merged commit 30d7c6b into main Sep 2, 2026
8 checks passed
@ocots
ocots deleted the docs/guide-anchors branch September 2, 2026 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run documentation Trigger the Documentation workflow on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs: stable anchor ids for guide pages

1 participant