Closed 2bndy5 closed 1 year ago
Thanks for working on this!
I hate to give you more work, but given that Sphinx's implementation of these version directives is not that simple, and has various conditions as far as how to handle the title, and also registers the entries in the ChangeSetDomain
, I'm thinking it may be better to leave the version directives alone.
In order to style them, we could either do it purely with CSS, using Sphinx's original HTML output, or could add an override to our HTML translator for the versionmodified node. That would avoid adding complexity to the admonition directive, avoid duplicating the existing logic of the version directives, and allow the ChangeSet domain to continue working.
I had thought of doing that at one point in the dev process, but I was too curious to see how the no-content stuff would work out.
I'll start a new branch and begin approaching the issue from the CSS side instead (probably tomorrow). The only drawback that I can think of is that CSS is harder for users to undo since we can't conveniently have a confval
like we do here, but maybe I can figure that out on the way. It also might be easier for users to change the icons used for these directives using the custom admonitions approach, but again I'll see what I can whip up.
resolves #243
versionadded
,versionchanged
, anddeprecated
with custom admonition directives.sphinx_immaterial_override_version_directives
to disable this new behavior.