- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
basic CSS: Take "simple" lists into account, resuscitating the "html_compact_lists" config option #7852
Conversation
For comparison, the rendering of the |
|
Thanks @jakobandersen, I've removed the The other things you mention sound good, but they should be done in a separate issue/PR, right? |
I'm not sure. In a sense it belongs together with this, and probably also the other general CSS rules for lists discussed in #7838. It's not immediately clear to me which rules are really needed in the end, and the exact reasoning behind them all. |
I thought that "compact" lists can contain "non-compact" sub-lists. I was wrong. I read again the definition at https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-html_compact_lists:
This implies, from a CSS point of view, that the Also I previously wasn't completely aware of the "and/or" part of the definition. With this new (for me) knowledge, I made some adaptations to the CSS in this PR: 82768d8. With these changes, no changes to the Python code are necessary and I think it finally looks exactly as intended: Note the correct space after compact lists which are nested within non-compact lists. Also note the correct space between the separate lists in the last list item. The space between "1. Arabic numerals." and "a. lower alpha)" might seem out of place given the further sub-lists, but I think it's actually correct. The main list (numbered 1. and 2.) is "non-compact" (because item 2 contains more than "a single paragraph and/or a [single] sub-list") while the nested lists (a., i., A., I.) are "compact". BTW, the |
@mgeier wrote #7657 (comment)
I am very sorry, I have my own timeline in another Open-Source project .. thanks for your investigation! For the future you better might pick some tests from wider docs .. e.g. the themes from poco often used .. or use the one from us :)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for late. Looks good to me. So merging this now.
See #7838, where the CSS classes
compact
andsimple
have been mentioned.I'm not sure if that's the best solution, but it should definitely be a basis for further discussion.
This is how it looks with the docutils demo https://github.com/docutils/docutils/blob/master/docutils/docs/user/rst/demo.txt, using the
sphinxdoc
theme:Before:
Between (Sphinx 3.1):
After:
There is still something strange happening in the last case:
The list containing "Third level." and "Item 2." doesn't get thesimple
class, but the one containing it does.I think those two cases should be reversed, right?I guess that's a bug?