jbms / sphinx-immaterial

Adaptation of the popular mkdocs-material material design theme to the sphinx documentation system
https://jbms.github.io/sphinx-immaterial/
Other
195 stars 31 forks source link

support version directives #244

Closed 2bndy5 closed 1 year ago

2bndy5 commented 1 year ago

resolves #243

jbms commented 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.

2bndy5 commented 1 year ago

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.