fix(docs): widen field-list labels so 'Parameters:' isn't a column#12415
Draft
Bojun-Vvibe wants to merge 1 commit intoaio-libs:masterfrom
Draft
fix(docs): widen field-list labels so 'Parameters:' isn't a column#12415Bojun-Vvibe wants to merge 1 commit intoaio-libs:masterfrom
Bojun-Vvibe wants to merge 1 commit intoaio-libs:masterfrom
Conversation
Sphinx renders ``:param:``/``:return:`` field-list ``<dt>`` elements with a tiny intrinsic width, which on the current theme collapses labels like "Parameters:" into a one-character-wide vertical column. Add a min-width: 6em rule to dl.field-list>dt in the custom stylesheet.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #12415 +/- ##
=======================================
Coverage 98.92% 98.92%
=======================================
Files 134 134
Lines 46751 46751
Branches 2430 2430
=======================================
Hits 46249 46249
Misses 373 373
Partials 129 129
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Merging this PR will not alter performance
Comparing Footnotes
|
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.
Closes #4127
Repo
aio-libs/aiohttp
Issue
#4127
Root cause
Sphinx renders the
:param:/:return:/:raise:field-list labels("Parameters:", "Returns:", "Raises:", ...) as
<dt>elements inside<dl class="field-list">. With the current theme + browser defaults the<dt>is given a minimal intrinsic width, so on narrower viewports thelabel collapses into a one-character-wide vertical column, making it
look like text written top-to-bottom.
Fix
Add a tiny CSS rule to the project's custom stylesheet
(
docs/_static/css/logo-adjustments.css) givingdl.field-list>dtamin-width: 6em(the value suggested in the issue) so the label keepsenough horizontal space to render on a single line.
Regression test
None. The change is a pure CSS rule in the docs stylesheet; aiohttp has
no automated visual / CSS tests for the rendered HTML, and the existing
test suite does not cover Sphinx output. A towncrier news fragment
(
CHANGES/4127.doc.rst) is included instead.Risk
trivial
Verification
skipped: pure docs/CSS change, no executable test path. Manually verified
the targeted selector matches Sphinx's field-list markup
(
<dl class="field-list"><dt>Parameters</dt>...) and that the rule isscoped narrowly enough not to affect other
<dl>content.