Skip to content

Fix generated docs see also links#6355

Merged
JanuszL merged 1 commit into
NVIDIA:mainfrom
JanuszL:fix_docs_see_also_links
May 22, 2026
Merged

Fix generated docs see also links#6355
JanuszL merged 1 commit into
NVIDIA:mainfrom
JanuszL:fix_docs_see_also_links

Conversation

@JanuszL

@JanuszL JanuszL commented May 19, 2026

Copy link
Copy Markdown
Contributor

Generate operator See also entries with Sphinx doc references instead of
raw root-relative HTML links. The root-relative form resolves outside the
DALI docs tree on docs.nvidia.com, so links from generated operator pages
can point at dead /examples/... URLs.

Let Sphinx resolve the target document from the generated page location so
the resulting href stays within the deployed user guide for both pipeline
and dynamic operation pages.

Category:

Bug fix (non-breaking change which fixes an issue)

Description:

Fix generated operator documentation links in See also sections.

PR #6140 changed the generated references from relative links to
root-relative HTML links such as /examples/.... On docs.nvidia.com these
resolve outside the DALI user guide tree, making links at the bottom of
operator pages dead.

This change emits :doc: references to the target documents instead. Sphinx
then resolves the correct relative link from each generated operator page.

Additional information:

Affected modules and functionalities:

Generated operator documentation pages that include See also links to
examples.

Key points relevant for the review:

The important bit is that the generated RST now points at Sphinx documents
instead of raw root-relative HTML paths. This keeps the deployed links inside
the active DALI documentation tree.

Tests:

  • Existing tests apply
  • New tests added
    • Python tests
    • GTests
    • Benchmark
    • Other
  • N/A

Checklist

Documentation

  • Existing documentation applies
  • Documentation updated
    • Docstring
    • Doxygen
    • RST
    • Jupyter
    • Other
  • N/A

DALI team only

Requirements

  • Implements new requirements
  • Affects existing requirements
  • N/A

REQ IDs: N/A

JIRA TASK: DALI-4707

Generate operator `See also entries` with Sphinx doc references instead of
raw root-relative HTML links. The root-relative form resolves outside the
DALI docs tree on docs.nvidia.com, so links from generated operator pages
can point at dead /examples/... URLs.

Let Sphinx resolve the target document from the generated page location so
the resulting href stays within the deployed user guide for both pipeline
and dynamic operation pages.

Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com>
@JanuszL JanuszL force-pushed the fix_docs_see_also_links branch from f397f06 to 3e3c16e Compare May 19, 2026 09:12
@JanuszL

JanuszL commented May 19, 2026

Copy link
Copy Markdown
Contributor Author

!build

@dali-automaton

Copy link
Copy Markdown
Collaborator

CI MESSAGE: [51797027]: BUILD STARTED

@greptile-apps

greptile-apps Bot commented May 19, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Fixes broken See-also links in generated operator documentation pages by replacing raw root-relative HTML anchors with Sphinx :doc: cross-references. The previous form (/examples/...) resolved outside the DALI docs tree when deployed to docs.nvidia.com; the new :doc: role lets Sphinx produce correct relative links from each generated page.

  • get_references now strips the .html suffix (safe — _collect_references always produces .html via Path.with_suffix) and emits :doc:\desc `` instead of a plain hyperlink.
  • All downstream call sites (single_fun_file, single_class_op_file, single_module_file) benefit automatically since they all funnel through get_references.

Confidence Score: 5/5

Single-function, two-line change that correctly swaps root-relative HTML anchors for Sphinx :doc: cross-references; all data flowing into the function is guaranteed to carry .html suffixes.

The change is minimal and targeted. removesuffix(".html") is unconditionally safe because every URL in the references dict is produced by Path.with_suffix(".html") in _collect_references. The :doc: role with an absolute path (/examples/...) is standard Sphinx and will resolve correctly from any location within the source tree, including the generated operations/ subdirectory. No logic outside get_references is touched.

No files require special attention.

Important Files Changed

Filename Overview
docs/autodoc_submodules.py Switches See-also links from root-relative HTML anchors to Sphinx :doc: cross-references; removesuffix(".html") is safe because _collect_references always produces .html paths via with_suffix.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["doc_index.document_examples(examples/index.py)"] --> B["_collect_references\nurl = base_path/entry.html"]
    B --> C["references dict\n{fn.resize: [(desc, examples/.../page.html)]}"]
    C --> D["get_references(name, references)"]
    D --> E["url.removesuffix('.html')\n-> examples/.../page"]
    E --> F["emit :doc:`desc </examples/.../page>`"]
    F --> G["Sphinx resolves to relative link\nwithin deployed docs tree"]

    style G fill:#90EE90
Loading

Reviews (1): Last reviewed commit: "Fix generated docs see also links" | Re-trigger Greptile

@rostan-t rostan-t self-assigned this May 19, 2026
@dali-automaton

Copy link
Copy Markdown
Collaborator

CI MESSAGE: [51797027]: BUILD FAILED

@dali-automaton

Copy link
Copy Markdown
Collaborator

CI MESSAGE: [51797027]: BUILD PASSED

@JanuszL JanuszL changed the title Fix generated docs see also links Fix generated docs see also links May 22, 2026
@JanuszL JanuszL merged commit e77e77e into NVIDIA:main May 22, 2026
7 checks passed
@JanuszL JanuszL deleted the fix_docs_see_also_links branch May 22, 2026 14:39
JanuszL added a commit that referenced this pull request May 22, 2026
Generate operator `See also entries` with Sphinx doc references instead of
raw root-relative HTML links. The root-relative form resolves outside the
DALI docs tree on docs.nvidia.com, so links from generated operator pages
can point at dead /examples/... URLs.

Let Sphinx resolve the target document from the generated page location so
the resulting href stays within the deployed user guide for both pipeline
and dynamic operation pages.

Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com>
JanuszL added a commit that referenced this pull request May 22, 2026
Generate operator `See also entries` with Sphinx doc references instead of
raw root-relative HTML links. The root-relative form resolves outside the
DALI docs tree on docs.nvidia.com, so links from generated operator pages
can point at dead /examples/... URLs.

Let Sphinx resolve the target document from the generated page location so
the resulting href stays within the deployed user guide for both pipeline
and dynamic operation pages.

Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com>
mdabek-nvidia pushed a commit to mdabek-nvidia/DALI that referenced this pull request May 27, 2026
Generate operator `See also entries` with Sphinx doc references instead of
raw root-relative HTML links. The root-relative form resolves outside the
DALI docs tree on docs.nvidia.com, so links from generated operator pages
can point at dead /examples/... URLs.

Let Sphinx resolve the target document from the generated page location so
the resulting href stays within the deployed user guide for both pipeline
and dynamic operation pages.

Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com>
mdabek-nvidia pushed a commit to mdabek-nvidia/DALI that referenced this pull request May 29, 2026
Generate operator `See also entries` with Sphinx doc references instead of
raw root-relative HTML links. The root-relative form resolves outside the
DALI docs tree on docs.nvidia.com, so links from generated operator pages
can point at dead /examples/... URLs.

Let Sphinx resolve the target document from the generated page location so
the resulting href stays within the deployed user guide for both pipeline
and dynamic operation pages.

Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com>
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.

4 participants