Skip to content

Commit

Permalink
docs: fix word wrap in tables
Browse files Browse the repository at this point in the history
The sphinx-rtd-theme currently disables word wrap in table cells due to
a bug: readthedocs/sphinx_rtd_theme#1505
This is fixed by overriding the CSS and enabling word wrapping.
  • Loading branch information
jkhsjdhjs committed Jan 3, 2024
1 parent 96dafbe commit 5a1282c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
9 changes: 9 additions & 0 deletions docs/source/_static/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
@import 'css/theme.css';

/* Fix white-space wrapping in tables.
* See https://github.com/readthedocs/sphinx_rtd_theme/issues/1505
* This is included via html_static_path and html_style in conf.py
*/
.wy-table-responsive table td {
white-space: normal;
}
7 changes: 6 additions & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,12 @@ def setup(app):
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = []
html_static_path = ['_static']

# Fix white-space wrapping in tables.
# See https://github.com/readthedocs/sphinx_rtd_theme/issues/1505
# Once fixed, this can be removed and '_static' can be removed from html_static_path.
html_style = 'custom.css'

# Configuration of the 'Edit on GitHub' button at the top right.
html_context = {
Expand Down

0 comments on commit 5a1282c

Please sign in to comment.