Skip to content

Use indexed option directive on unit reference documentation (Infra)#1739

Merged
Hook25 merged 7 commits intomainfrom
CHECKBOX-1747-doc-anchors
Feb 20, 2025
Merged

Use indexed option directive on unit reference documentation (Infra)#1739
Hook25 merged 7 commits intomainfrom
CHECKBOX-1747-doc-anchors

Conversation

@tang-mm
Copy link
Copy Markdown
Collaborator

@tang-mm tang-mm commented Feb 19, 2025

Description

The unit references currently use definition lists for explaining each field, but each element is not indexed so cannot be cross-referenced. This PR replaces those <dl> list and manually defined anchors with the :option: directive in Sphinx

  • Field names are defined with .. option:: name, and then are indexed during doc build
    • the defined fields can be cross-referenced by using :option: `name`
  • Scope can be defined with .. program:: unit, so that duplicated option names can be specified by adding the scope name before the field :option: `unit name`
  • Update CSS style for the generated .sig elements
  • Update spelling check settings to ignore field names with .sig CSS class

Chore:

  • Enabled fail_on_warning on readthedocs build to prevent broken links

Resolved issues

CHECKBOX-1747

Documentation

NA

Tests

PR checks on Readthedocs
Preview: https://canonical-checkbox--1739.com.readthedocs.build/en/1739/reference/units/job.html

@tang-mm tang-mm requested a review from pieqq February 19, 2025 12:33
@tang-mm tang-mm changed the title Infra: use indexed option directive on unit reference documentation Use indexed option directive on unit reference documentation (Infra) Feb 19, 2025
@tang-mm
Copy link
Copy Markdown
Collaborator Author

tang-mm commented Feb 19, 2025

Fixed ↓
CSS style behaves differently than my local build, fix needed :(

Copy link
Copy Markdown
Collaborator

@Hook25 Hook25 left a comment

Choose a reason for hiding this comment

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

lgtm, should we enable fail on warning on all doc sets?

@Hook25 Hook25 merged commit f021332 into main Feb 20, 2025
11 checks passed
@Hook25 Hook25 deleted the CHECKBOX-1747-doc-anchors branch February 20, 2025 09:55
@tang-mm
Copy link
Copy Markdown
Collaborator Author

tang-mm commented Feb 20, 2025

fail_on_warning is enabled by default in later versions of the Sphinx template. Checkbox is an early adopter so it was not here, but most other doc sets already have them :)

@Hook25
Copy link
Copy Markdown
Collaborator

Hook25 commented Feb 20, 2025

do double check on the others if you have some time, I'm pretty sure testflinger doesn't have it

@tang-mm
Copy link
Copy Markdown
Collaborator Author

tang-mm commented Feb 20, 2025

Nice reminder! The option was removed from Testflinger two weeks ago 🤔

@Hook25
Copy link
Copy Markdown
Collaborator

Hook25 commented Feb 20, 2025

now I remember, I approved that PR. The problem with that option is that the build fails on readthedocs but not locally and I couldn't find a way to make it behave the same, which is pretty crappy. Can you please look into that as well? The behaviour should be the same

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.

2 participants