Skip to content

Commit

Permalink
feat(rtd): provide custom CSS file for overriding in-use Sphinx theme
Browse files Browse the repository at this point in the history
* `sphinx_rtd_theme` known issue: long lines in tables do not wrap by default
  - readthedocs/sphinx_rtd_theme#117
  • Loading branch information
myii committed Mar 1, 2019
1 parent 18d3924 commit 24bd338
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
18 changes: 18 additions & 0 deletions docs/_static/css/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
Override styles for in-use Sphinx theme
*/

/* override table width restrictions */
.wy-table-responsive table th
, .wy-table-responsive table td
{
/* !important prevents the common CSS stylesheets from
overriding this as on RTD they are loaded after this stylesheet */
white-space: normal !important;
}

.wy-table-responsive
{
overflow: visible !important;
}

22 changes: 22 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,3 +149,25 @@
'manual',
),
]


# -- Functions: `setup`, docstring preprocessing, etc. -----------------------

def setup(app):
"""Prepare the Sphinx application object.
Used for providing a custom CSS file for override styles.
Parameters
----------
app : object
The Sphinx application object.
Returns
-------
app : object
The Sphinx application object.
"""
app.add_stylesheet('css/custom.css')
return app

0 comments on commit 24bd338

Please sign in to comment.