-
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
API docs look different with Sphinx 2.0 #766
Comments
Setting |
Is this python domain API output? Thanks for the workaround for now! 🎉 |
As far as I am concerned the most problematic thing by far is the lack of spacing between the parameter name and the parameter type. This has lead confusion for our users. For example, in the top post example, people would try to use The spacing issue has been reported in #746 and there is an associated PR #747 that will fix it. Unfortunately this PR does not seem to have received too much attention. I am guessing part of the reason is because it is a wide-reaching change. For my project, # Temporary work-around for spacing problem between parameter and parameter
# type in the doc, see https://github.com/numpy/numpydoc/issues/215. The bug
# has been fixed in sphinx (https://github.com/sphinx-doc/sphinx/pull/5976) but
# through a change in sphinx basic.css except rtd_theme does not use basic.css.
# In an ideal world, this would get fixed in this PR:
# https://github.com/readthedocs/sphinx_rtd_theme/pull/747/files
def setup(app):
app.add_stylesheet("basic.css") |
The fix in #747 is probably not the optimal solution, we'd rather repair our CSS rulesets. Can you clarify which domain this is using so that we can reproduce? |
Not sure what you mean by "which domain" but here is a way to reproduce: conda create -n test-rtd -y -c conda-forge dask-jobqueue sphinx numpydoc -y
conda activate test-rtd
pip install dask_sphinx_theme
git clone https://github.com/dask/dask-jobqueue
# Goes back to an older version where we did not roll out our own fix
git checkout 0.6.1
cd dask-jobqueue/docs
make html If you open |
The domain is the sphinx domain: Which language are you documenting? Python? I'm not sure why the display is combined there. I probably won't have time to dig into your documentation to debug. You can help by providing the generated source reST that produced the above output so that we can create a test case in our docs if there isn't one already. |
This does not work for me unfortunately. |
Yes Python.
As someone involved in the maintenance of open-source projects, at least one of them reasonably popular, I fully sympathise with this. My feeling though is that the root cause of the problem is understood and that a fix at the CSS level would be to add this (diff from sphinx-doc/sphinx#5976). .classifier:before {
font-style: normal;
margin: 0.5em;
content: ":";
} Is there a chance this fix gets added to #838 (I am afraid that my web skills are limited and I don't know sass at all ...)? I agree that some comments have been scattered across separate issues, so that this is not very easy to follow. Let me try to summarize:
|
How to get this grey columnar box behind "Parameters:"? This is not showing for me at all. |
Ah thanks @lesteve! That's helpful. I'll add it to our list of Sphinx 2 compatibility fixes. That does indeed look like the fix we need to add. |
FWIW, using: def setup(app):
app.add_stylesheet("basic.css") fixed the original issue for me BUT introduced other problems (alignment in some tables). .classifier:before {
font-style: normal;
margin: 0.5em;
content: ":";
} to a _static/custom.css file (and activating it by adding these lines to my conf.py) seems to work without negative side effect: html_static_path = ['_static']
html_css_files = [
'custom.css',
] |
0.5.0rc1 is release to PyPI and should contain fixes for this issue. Can anyone verify? |
I can confirm using 0.5.0rc1 fixed this issue. Thanks! |
Great, I'll close this for now. I'm hoping to address some issues with a follow up rc release today and we should move pretty quick towards a full release after that. |
@fladd Were you able to get the gray column box behind I want to achieve this style as show in sphinx-rtd-theme documentation page: @agjohnson, @fladd , Can you provide any insights on what could be wrong on my settings? Thanks 🙏 |
Finally I am able to achieve same appearance by using this .rst-content dl:not(.docutils) dt:first-child {
margin-top: 0;
}
.rst-content dl:not(.docutils) dl dt {
margin-bottom: 4px;
border: none;
border-left: solid 3px #ccc;
background: #f0f0f0;
color: #555;
}
.rst-content dl table,
.rst-content dl ul,
.rst-content dl ol,
.rst-content dl p {
margin-bottom: 8px !important;
}
.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;
}
html.writer-html5 .rst-content dl.field-list {
display: initial;
}
html.writer-html5 .rst-content dl.field-list>dd,
html.writer-html5 .rst-content dl.field-list>dt {
margin-bottom: 4px;
padding-left: 6px;
}
p {
line-height: 20px;
font-size: 14px;
}
html.writer-html5 .rst-content dl.field-list>dt:after {
content: initial;
} in html_css_files = [
'custom.css'
] Also I found the reason why field lists like |
Problem
The HTML API docs generated with Sphinx 2.0 do not display the colons separating parameter names and types. Moreover, the look has significantly changed.
Expected Results
Obtained Results
Environment Info
More Info / Related links
gammapy/gammapy#2164
sphinx-doc/sphinx#6400
The text was updated successfully, but these errors were encountered: