Infra: Increase spacing between complex list items #3662
Merged
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.
A "simple" list is one whose items all consist of a single paragraph, optionally followed by a nested list which is itself simple. Sphinx detects such lists and gives them the
simple
class, but does not make any other structural changes to the HTML output.The PEP style sheet currently does nothing with this class. As a result, when a list contains a mixture of single-paragraph and multi-paragraph items, it's common for a paragraph to appear closer to paragraphs of a different item than it is to other paragraphs of the same item. This obscures the logical structure of the text.
This PR fixes that by adding spacing between the items of "complex" (i.e. non-simple) lists, equal to the spacing between regular paragraphs. For example, in PEP 595:
By definition, a simple list cannot contain a complex list. But if a complex list contains a simple list, it is still rendered compactly. For example, in PEP 572:
A multi-level simple list only has the
simple
class on its top-level element. The rendering of such lists has not changed. For example, in PEP 432 (BEFORE / AFTER):📚 Documentation preview 📚: https://pep-previews--3662.org.readthedocs.build/