Skip to content

doc: Add Sphinx extension for badges - #118

Draft
mschwan-phytec wants to merge 2 commits into
mainfrom
wip-doc-badges
Draft

mschwan-phytec wants to merge 2 commits into
mainfrom
wip-doc-badges

Conversation

@mschwan-phytec

Copy link
Copy Markdown
Collaborator

Add a local Sphinx extension that allows placing badges for the data type, requirement state and when the functionality got added. The "since" badges automatically create links to the changelog.

The layout configuration reference describes the type, state and
release of each option as plain text. This is hard to scan and has to
be repeated by hand for every option.

Add a local Sphinx extension "badges" that renders this metadata as
badges. It provides the roles :badge-type:, :badge-state:, :badge-since:
and :badge:. The since badge links to the release notes. The link target
is built from the new config value badges_release_notes_ref, a template
for the reference label containing the version, e.g. "release-{version}".

Style the badges in badges.css and load the extension and the stylesheet
from conf.py. Ignore the __pycache__ directories created when importing
the extension.

Signed-off-by: Martin Schwan <m.schwan@phytec.de>
Use the new badges extension to show the metadata of each option in the
layout configuration reference instead of plain text:

  - Replace the "(type)" suffixes with type badges. Options accepting
    multiple types get one badge per type.
  - Add state badges for the options whose state is fixed.
  - Replace the "Available since" paragraphs with since badges linking
    to the release notes.

Clean entries must contain an offset and a size, so change "should" to
"must" in the description of the clean section accordingly.

Lay out the definition list terms as a flex container in the theme
stylesheet, so that the type badge is aligned to the right of the option
name.

Signed-off-by: Martin Schwan <m.schwan@phytec.de>
@mschwan-phytec
mschwan-phytec marked this pull request as draft October 16, 2026 13:19

This branch has not been deployed

No deployments
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