Skip to content

docs(python): fix duplicated headings on layers and types API pages#7880

Merged
chitralverma merged 2 commits into
apache:mainfrom
chitralverma:fix-py-docs-duplicate-headings
Jul 7, 2026
Merged

docs(python): fix duplicated headings on layers and types API pages#7880
chitralverma merged 2 commits into
apache:mainfrom
chitralverma:fix-py-docs-duplicate-headings

Conversation

@chitralverma

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

No tracking issue.

Rationale for this change

The layers and types API pages render each class twice. Each entry has a manual Markdown ## <Name> heading before the mkdocstrings block, and mkdocstrings also renders its own heading for the class, producing two headings (and two table-of-contents entries) per class. The single-class pages (e.g. operator.md) omit the manual heading and render once.

What changes are included in this PR?

Remove the redundant manual ## <Name> headings from docs/api/layers.md and docs/api/types.md so each class renders a single heading via mkdocstrings.

Are there any user-facing changes?

Docs only. Each class now appears once on its API page.

AI Usage Statement

Implemented with an AI coding agent (opencode, Claude Opus). Validated with mkdocs build.

The layers and types API pages put a manual Markdown heading before each
mkdocstrings block, while mkdocstrings also renders its own heading for the
class. That produced two headings (and two table-of-contents entries) per
class. Drop the redundant manual headings so each class renders once, matching
the single-class API pages.
Copilot AI review requested due to automatic review settings July 7, 2026 12:43
@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. releases-note/docs The PR modifies docs related content or has a title that begins with "docs" labels Jul 7, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes duplicated headings in the Python API documentation pages for layers and types by removing manual Markdown ## <Name> headings and relying on mkdocstrings to render a single heading per documented class/type.

Changes:

  • Removed redundant manual ## headings before mkdocstrings blocks in docs/api/layers.md.
  • Removed redundant manual ## headings before mkdocstrings blocks in docs/api/types.md.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
bindings/python/docs/api/types.md Removes manual ## headings so mkdocstrings produces a single heading/ToC entry per type.
bindings/python/docs/api/layers.md Removes manual ## headings so mkdocstrings produces a single heading/ToC entry per layer.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@dosubot dosubot Bot added size:S This PR changes 10-29 lines, ignoring generated files. and removed size:XS This PR changes 0-9 lines, ignoring generated files. labels Jul 7, 2026
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Jul 7, 2026
@chitralverma chitralverma merged commit 742ce3d into apache:main Jul 7, 2026
37 checks passed
@chitralverma chitralverma deleted the fix-py-docs-duplicate-headings branch July 7, 2026 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer releases-note/docs The PR modifies docs related content or has a title that begins with "docs" size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants