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

Provide better CSS selectors for API-documentation content #9663

Open
pradyunsg opened this issue Sep 22, 2021 · 3 comments
Open

Provide better CSS selectors for API-documentation content #9663

pradyunsg opened this issue Sep 22, 2021 · 3 comments
Labels
builder:html type:enhancement enhance or introduce a new feature

Comments

@pradyunsg
Copy link
Contributor

pradyunsg commented Sep 22, 2021

Is your feature request related to a problem? Please describe.

It is fairly difficult to stylise the content produced by autodoc, due to lack of selectors for certain elements.

Describe the solution you'd like

Provide selectors for these cases, so that this content can be stylised to look good. :)

Describe alternatives you've considered

Not providing these selectors, and maintaining status quo? That's suboptiomal but certainly an option. It is also possible for downstream themes to rewrite whatever output autodoc generates,

Additional context

pdoc3 has IMO very nice signature presentation for API documentation. Presentation like that is not possible with Sphinx, due to the lack of such selectors.

https://pdoc3.github.io/pdoc/doc/pdoc/html_helpers.html

@pradyunsg pradyunsg added the type:enhancement enhance or introduce a new feature label Sep 22, 2021
@jakobandersen
Copy link
Contributor

Basically I agree. Part of it may be lack of documentation of some of the more recent changes to make CSS styling easier. After #9672 and #9695 has been merged I'll try to get started on the documentation update.
As the content is generated from many different places in Sphinx (each domain, field list handling, autodoc?, etc.) is may be useful at some point if you can elaborate/enumerate what "these cases" are.

@pradyunsg
Copy link
Contributor Author

pradyunsg commented Oct 2, 2021

"these cases" are.

These cases refers to the bullets listed above, which are the specific bits of content that can't be selected through the CSS to stylize.

@pradyunsg
Copy link
Contributor Author

#9740 reminds me that having some data members that lists the number of arguments of a function would help as well!

I think paramers are wrapped in Sphinx 4, so combined with such a member, it should be possible for downstream themes to implement the wrapping that the user is asking for in that issue, while avoiding wrapping behaviour like that for single-argument calls.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
builder:html type:enhancement enhance or introduce a new feature
Projects
None yet
Development

No branches or pull requests

4 participants