Skip to content

docs: Fix duplicate toctree references causing build warnings - #19027

Merged
lupyuen merged 1 commit into
apache:masterfrom
RogerNext:fix/doc-toctree-warnings
Jun 3, 2026
Merged

lupyuen merged 1 commit into
apache:masterfrom
RogerNext:fix/doc-toctree-warnings

Conversation

@RogerNext

Copy link
Copy Markdown
Contributor

Summary

Fix Sphinx documentation build warnings caused by documents referenced in multiple toctrees.

Fixes #14785

Problem

Several .rst files are referenced by both a parent toctree (via glob pattern) and a child toctree (explicit entry), causing Sphinx warnings:

document is referenced in multiple toctrees: [...], selecting: [...]

Affected files:

  • components/drivers/special/power/pm/index.rst
  • platforms/arm/goldfish/goldfish_timer.rst
  • platforms/arm/nrf52/ieee802154.rst
  • platforms/sim/network_linux.rst
  • platforms/sim/network_vpnkit.rst

Fix

  1. platforms/arm/index.rst: Narrow glob pattern from */* to */index — only match subdirectory index files, not their children.

  2. platforms/index.rst: Same glob narrowing from */* to */index.

  3. guides/changing_systemclockconfig.rst: Replace .. toctree:: directive with :doc: cross-reference, since this is a guide page that links to PM docs, not a structural parent.

These are the only non-index .rst files at the affected directory levels, so the narrowed globs remain functionally equivalent while eliminating the duplicate references.

Testing

Verified that no other non-index .rst files exist at the affected directory levels that would be missed by the narrowed glob patterns.

@github-actions github-actions Bot added Area: Documentation Improvements or additions to documentation Arch: simulator Issues related to the SIMulator Size: S The size of the change in this PR is small labels Jun 2, 2026
@RogerNext
RogerNext force-pushed the fix/doc-toctree-warnings branch from e9f60e0 to d96fd47 Compare June 3, 2026 00:35
@RogerNext
RogerNext requested a review from GUIDINGLI as a code owner June 3, 2026 00:35
Comment thread arch/sim/src/sim/sim_usrsock.c Resolved
Several documentation files are referenced in multiple toctrees,
causing Sphinx build warnings like:

  document is referenced in multiple toctrees: [...], selecting: [...]

Fix by narrowing glob patterns in parent toctrees to only match
subdirectory index files, and replacing a toctree directive with
a :doc: cross-reference:

- platforms/arm/index.rst: glob */* -> */index
- platforms/index.rst: glob */* -> */index
- guides/changing_systemclockconfig.rst: toctree -> :doc: ref

Fixes apache#14785

Signed-off-by: hanzj <[email protected]>
@RogerNext
RogerNext force-pushed the fix/doc-toctree-warnings branch from d96fd47 to a48ffb7 Compare June 3, 2026 02:07
@github-actions github-actions Bot removed the Arch: simulator Issues related to the SIMulator label Jun 3, 2026

@RogerNext RogerNext left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed: rebased onto upstream/master, the unrelated usrsock change is now removed. Only the 4 documentation files are modified.

@lupyuen
lupyuen merged commit 0916a88 into apache:master Jun 3, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: Documentation Improvements or additions to documentation Size: S The size of the change in this PR is small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] warnings in Documentation build (document is referenced in multiple toctrees)

4 participants