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

autosummary tables could use an extension-specific CSS class #10234

Closed
2bndy5 opened this issue Mar 3, 2022 · 1 comment
Closed

autosummary tables could use an extension-specific CSS class #10234

2bndy5 opened this issue Mar 3, 2022 · 1 comment
Labels
extensions:autosummary type:enhancement enhance or introduce a new feature
Milestone

Comments

@2bndy5
Copy link

2bndy5 commented Mar 3, 2022

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

We are working on a theme that does not inherit from a builtin theme's CSS. When using autosummary with this theme, the tables inherit a CSS rule not designed for autosummary tables. We'd like a way to identify (via CSS) an autosummary table from other parts of the document(s).

Describe the solution you'd like

In discussing how to override our theme's rule using a way to only target autosummary tables, we've agreed that autosummary should use an extension-specific CSS class that would distinguish its tables.

Describe alternatives you've considered

  1. Use a special CSS override whose selectors target only autosummary tables. This approach carries some uncertainty because of the problem stated above. In the meantime, we've gone with this approach since the longtable CSS class seems to be intended for latex writers.
  2. Monkey patch the autosummary_table_visit_html() in our theme's source. This seems unnecessarily complex to target only autosummary tables. It also may not be forward compatible.

Additional context

The theme's css rule that causes problems is

.md-typeset code {word-break: break-word;}

We needed to design a rule that sets word-break: normal; as it was presumptuously intended by autosummary.

Our theme's issue was reported in jbms/sphinx-immaterial#35

@tk0miya
Copy link
Member

tk0miya commented Mar 6, 2022

I added "autosummary" class to the tables generated by autosummary directive in #10239. Could you check it please?

@tk0miya tk0miya closed this as completed in cac69ad Mar 6, 2022
tk0miya added a commit that referenced this issue Mar 6, 2022
Close #10234: autosummary: Add "autosummary" CSS class to summary tables
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
extensions:autosummary type:enhancement enhance or introduce a new feature
Projects
None yet
Development

No branches or pull requests

2 participants