-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Rendering of Definition List/Option List/Field List #979
Comments
Same here. |
It seems to have disappeared in commit ff594d2 by @agjohnson |
Oops, I see the issue. Nothing disappeared, but the versioned docs are being built with PR builds use the local version of the theme, not a pinned version of the PyPI theme. I'd prefer if the versioned docs are built using the local theme as well -- that is, 0.5.0 docs use the local 0.5.0 of the theme -- but I think there were some objections to that previously. |
@agjohnson thanks for the info. so the design change was intended. that's good to know although I'm not 100% happy with it. I like it for the field list but not for the definition list. for the option list I'm uncertain... a little bit off topic but is the a easy way to revert it locally (css override) for the definition list but leave it for the field list? |
To bring back the definition list style, I added this CSS via a custom stylesheet file: .rst-content dl:not(.docutils) dt:first-child {
margin-top: 0;
}
.rst-content dl:not(.docutils) dt {
display: table;
margin: 6px 0;
font-size: 90%;
line-height: normal;
background: #e7f2fa;
color: #2980B9;
border-top: solid 3px #6ab0de;
padding: 6px;
position: relative;
} @agjohnson , are you 100% sure the removal of those styles was intentional, rather than by mistake? |
The intended styles are available at https://sphinx-rtd-theme--981.org.readthedocs.build/en/981/demo/lists_tables.html#definition-lists These styles match sphinx_rtd_theme version 0.4.2 with the Sphinx html4 writer. The first image you posted, sphinx_rtd_theme with the Sphinx html5 writer, is mostly buggy display, those were not intended to be the styles. Custom CSS should not be required, use 0.5.0 and the HTML5 writer.
Yes, intentional, to match the display styles of sphinx_rtd_theme 0.4.3 and html4 writer. 0.4.3 does not support the html5 writer. |
Hello! I’m very glad I found this because I believe I'm experiencing a similar issue. In my case, the option lists are rendered very stylishly on my local laptop, but they look really ugly in the web. This is what I see from my local laptop: This is what's rendered on the web (https://pypgx.readthedocs.io/en/latest/commands.html#options): @agjohnson, how can I tell readthedocs to use the "HTML5 writer" and Would greatly appreciate if you or anyone else can help me start enjoying the beautiful rendering of readthedocs again! |
Add the following to your conf.py
|
@Daltz333 Thank you very much for the reply! I followed your advice for one of my projects, and it is now showing the intended style for the option lists (thanks to html5), except they are still in "buggy display" as agjohnson mentioned above (https://stargazer.readthedocs.io/en/latest/documentation.html#options). I think it's because RTD is still using a lower version of sphinx_rtd_theme (the build history says it used v0.4.3). If you don't, could you please teach me how to properly specify a higher version of sphinx_rtd_theme (==v0.5.0)? |
@sbslee To specify a version of sphinx_rtd_theme, you'll need to create a requirements.txt file with the line
and then point RTD to this in your RTD interface, or through a RTD configuration file. |
@Daltz333 Thank you! I totally forgot about the existence of the RTD configuration file (.readthedocs.yml)! I got it confused with the conf.py file. Once I updated the configuration file, it finally successfully installed |
I also reproduced the issue. Even when specifying the HTML4 builder. I'm quite sure it's an issue when using Sphinx > 3. Since this repo uses an extremely old version of Sphinx for some reason. |
Hi, I just wanted to give an update to those who might be interested: For whatever reason, my website started displaying the option lists properly. I didn't change anything, it just got fixed (I'm using HTML5 and |
@sbslee what version of Sphinx do you use btw? |
@Daltz333 Looking at the latest build history (https://readthedocs.org/projects/stargazer/builds/11578782/), I think |
@agjohnson This has persisted into version 0.5.0. The CSS style provided by @jobec fixed my issue. Will this be fixed? |
Just a quick note to anyone else who may find themselves here, looking for a solution to the misplaced CSS for these lists. If using
And run Once I has updated to the latest release and rebuilt the HTML using Sphinx, these lists formatted correctly. |
This has been fixed except for the spacing issues with lists, to keep track of that issue see #1029. For those still experiencing the other issues make sure you are using spinx_rtd_theme 0.5.1 or greater and are not using the html4 writer. |
The new release should fix the field lists. See the isssue: readthedocs/sphinx_rtd_theme#979
It turns out that we were pinned to a really old version of sphinx_rtd_theme (version 0.4.3). This was probably causing rendering issues in the version hosted by read-the-docs (readthedocs/sphinx_rtd_theme#979)
The new release should fix the field lists. See the isssue: readthedocs/sphinx_rtd_theme#979 (cherry picked from commit a831368)
The new release should fix the field lists. See the isssue: readthedocs/sphinx_rtd_theme#979 (cherry picked from commit a831368)
The new release should fix the field lists. See the isssue: readthedocs/sphinx_rtd_theme#979 (cherry picked from commit a831368)
Problem
Definition List/Option List/Field List are rendered differently on ReadTheDocs than in a local build. See attached screenshots:
on https://sphinx-rtd-theme.readthedocs.io/en/0.5.0/
local build:
Environment Info
The text was updated successfully, but these errors were encountered: