sphinx_rtd_theme
sphinx_rtd_theme copied to clipboard
Allow specific deactivation of table handling
Setting the table class "rtd-exclude-wy-table" deactivates the normal table handling for this table.
So the table gets not wrapped into a "div.wy-table-responsive" container.
Needed by other Sphinx extensions, which care about their tables on their own.
Fixes #1179
@nienn : I hope this PR is fine and solves #117 as expected.
I have also added some documentation and a changelog entry. As this is my first PR on this project, please let me know if anything is missing.
Local tests together with Sphinx-Needs are looking great.
Thanks for the contribution, we'll see about getting this in version 1.1. I'll block this PR for now, we're still wrapping up a 1.0 release.
@agjohnson Thanks for your feedback and for the overall work on RTD.
The change itself is really small, one line. And it does not have any side-effects to the theme or any code. So really no chance to get this small bugfix into 1.0?
Not having a possibility of deactivating the automatic table handling makes RTD-Theme incompatible with some other sphinx-extensions. I, as an affected extension developer, would be happy to avoid this incompatibility as fast as possible.
The other solution would be to ask my users to use another theme or use the fork, which contains my changes. Something, I really don't like.
So really no chance to get this small bugfix into 1.0?
We'll look to getting this in for 1.1, we don't want to keep holding back a 1.0 release.
This issue is extremely critical for us. The fix solves a major problem that is affecting 100s of tables that we have in RTD theme. Any chance to get this in soon?
@agjohnson I was looking for a way to accomplish the same thing from the sphinx side but could not find it.
Found the following documentation that gives options for setting table
s and table cell
s width
s.
In the end however, everything gets wrapped in the div.wy-table-responsive
and the custom widths get ignored in favor of the css white-space: nowrap
:
- https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#table-directives
- https://docutils.sourceforge.io/docs/ref/rst/directives.html#table
Also, the js handling the responsive tables is on the theme side and it applies to every table that is not .field-list
, .footnote
or .citation
:
https://github.com/readthedocs/sphinx_rtd_theme/blob/3532ffc89bbf89ef7d2ac62d65b3683f588a9673/src/theme.js#L102
Although this is not an ideal solution, I think it's a good option to add.
Maybe instead of .rtd-exclude-wy-table
we could use a more semantic class like .unresponsive
.
This would also fix: #1246
Any updates on this?
1.1
is on the way and this PR is set to blocked
Anything I can do here?