Skip to content
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

Improve CSS for API documentation #307

Closed
choldgraf opened this issue Mar 18, 2021 · 5 comments · Fixed by #486
Closed

Improve CSS for API documentation #307

choldgraf opened this issue Mar 18, 2021 · 5 comments · Fixed by #486
Labels
bug Something isn't working 🏷️ design Related to look and feel of the theme

Comments

@choldgraf
Copy link
Member

In executablebooks/meta#286 @rscohn2 noticed that our CSS for API docs looks a bit wonky. @chrisjsewell pointed out that the CSS for this is here:

// auto-doc, see: https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#directive-autoattribute
// adapted from https://github.com/readthedocs/readthedocs.org/blob/master/readthedocs/core/static/core/css/theme.css
dl.module, dl.class, dl.exception, dl.function, dl.decorator, dl.data, dl.method, dl.attribute {

so we should fix up the CSS there so that this type of API docs looks good!

@choldgraf choldgraf added bug Something isn't working 🏷️ design Related to look and feel of the theme labels Mar 18, 2021
@rscohn2
Copy link
Contributor

rscohn2 commented Apr 6, 2021

I only have basic knowledge of CSS, but if someone could suggest what properties need to change I would like to try to fix this.

@pradyunsg
Copy link
Member

Do you have examples of this wonky looking pages?

I'm looking at https://sphinx-themes.org/sample-sites/sphinx-book-theme/demo/api.html, and it seems OK to me on mobile.

@rscohn2
Copy link
Contributor

rscohn2 commented Apr 6, 2021

The main problem seems to be the lack of spacing between the type and the identifier. I put a simple example and screenshot at executablebooks/meta#286
I see 'intsz' but it should be 'int sz'

I see the same problem looking at the C++ examples at:
https://sphinx-themes.org/sample-sites/sphinx-book-theme/demo/api.html#c-api

and I have many examples at:
https://oneapi-src.github.io/oneAPI-spec/elements/oneDNN/source/primitives/logsoftmax.html

@rscohn2
Copy link
Contributor

rscohn2 commented Apr 21, 2021

I added a custom.css with the following contents to fix the problem. Not sure if this is appropriate as a general fix.

/* A workaround for https://github.com/readthedocs/sphinx_rtd_theme/issues/647
 * Override display for function signatures so that there is spacing between
 * types and arguments */
dt {
    display: table-cell !important;
}

@choldgraf choldgraf changed the title API documentation CSS needs improvement Improve CSS for API documentation Apr 25, 2021
@rscohn2
Copy link
Contributor

rscohn2 commented Feb 16, 2022

Thanks for fixing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working 🏷️ design Related to look and feel of the theme
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants