gh-155095: Fix docs changes builder for our custom directives - #155100
Open
StanFromIreland wants to merge 1 commit into
Open
gh-155095: Fix docs changes builder for our custom directives#155100StanFromIreland wants to merge 1 commit into
StanFromIreland wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We need to extend
ChangesBuilder'stypemapwith entries for our customsoft-deprecatedanddeprecated-removeddirectives (the latter was accidentally ignored). We need a little helper,_fixup_changesetas the changeset text is recorded before the directive replaces the marker with a glossary reference so the soft deprecated text is rendered incorrectly (":term:`Soft deprecated` ..."). It also includes some additional handling fordeprecated-removedso that deprecations and removals are indexed separately.This does not fix the missing yellow source-line highlighting in the builder's source view, which uses a separate hard-coded directive list in Sphinx:
https://github.com/sphinx-doc/sphinx/blob/9af5b469df42c810c62453661c1974c0f254e674/sphinx/builders/changes.py#L118-L127
It should be fixed upstream (by changing
hltextto be derived from fromtypemap), as I don't think that adding logic to inject highlighting after the view is built or re-writing the builder is worth it for this.make changes#155095