Skip to content

Commit cb94e3b

Browse files
committed
docs(rtd): use conf.py to add custom css
1 parent 25586ae commit cb94e3b

File tree

2 files changed

+134
-0
lines changed

2 files changed

+134
-0
lines changed

docs/_static/css/custom.css

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/*
2+
Override styles for in-use Sphinx theme
3+
*/
4+
5+
/* override table width restrictions */
6+
.wy-table-responsive table th
7+
, .wy-table-responsive table td
8+
{
9+
/* !important prevents the common CSS stylesheets from
10+
overriding this as on RTD they are loaded after this stylesheet */
11+
white-space: normal !important;
12+
}
13+
14+
.wy-table-responsive
15+
{
16+
overflow: visible !important;
17+
}
18+

docs/conf.py

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
# -*- coding: utf-8 -*-
2+
"""Configuration file for the Sphinx documentation builder.
3+
4+
This file does only contain a selection of the most common options. For a
5+
full list see the documentation:
6+
7+
* http://www.sphinx-doc.org/en/stable/config
8+
9+
"""
10+
11+
# -- Project information -----------------------------------------------------
12+
13+
# project = 'template-formula'
14+
# copyright = __copyright__.replace('Copyright ', '').replace('(C) ', '') # noqa: A001
15+
# author = __author__
16+
#
17+
# # Currently have 3 options about how to display the `version`.
18+
# # All 3 are available below, with 2 of them disabled.
19+
# # The short X.Y version
20+
# # major, minor, micro = parse(__version__).base_version.split('.')
21+
# # version = f'{major}.{minor}'
22+
# # The short X.Y.Z version
23+
# version = parse(__version__).base_version
24+
# # The full version, including alpha/beta/rc tags
25+
# # version = __version__
26+
# release = __version__
27+
28+
29+
# -- General configuration ---------------------------------------------------
30+
31+
# If your documentation needs a minimal Sphinx version, state it here.
32+
#
33+
# needs_sphinx = '1.0'
34+
35+
# Add any Sphinx extension module names here, as strings. They can be
36+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
37+
# ones.
38+
# extensions = []
39+
40+
# Add any paths that contain templates here, relative to this directory.
41+
# templates_path = ['_templates']
42+
43+
# The suffix(es) of source filenames.
44+
# You can specify multiple suffix as a list of string:
45+
#
46+
# source_suffix = ['.rst', '.md']
47+
# source_suffix = '.rst'
48+
49+
# The master toctree document.
50+
# master_doc = 'index'
51+
52+
# The language for content autogenerated by Sphinx. Refer to documentation
53+
# for a list of supported languages.
54+
#
55+
# This is also used if you do content translation via gettext catalogs.
56+
# Usually you set "language" from the command line for these cases.
57+
language = None
58+
59+
# List of patterns, relative to source directory, that match files and
60+
# directories to ignore when looking for source files.
61+
# This pattern also affects html_static_path and html_extra_path .
62+
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
63+
64+
# The name of the Pygments (syntax highlighting) style to use.
65+
# pygments_style = 'sphinx'
66+
67+
68+
# -- Options for HTML output -------------------------------------------------
69+
70+
# The theme to use for HTML and HTML Help pages. See the documentation for
71+
# a list of builtin themes.
72+
#
73+
# html_theme = 'sphinx_rtd_theme'
74+
75+
# Theme options are theme-specific and customize the look and feel of a theme
76+
# further. For a list of options available for each theme, see the
77+
# documentation.
78+
#
79+
# html_theme_options = {}
80+
81+
# Add any paths that contain custom static files (such as style sheets) here,
82+
# relative to this directory. They are copied after the builtin static files,
83+
# so a file named "default.css" will overwrite the builtin "default.css".
84+
html_static_path = ['_static']
85+
86+
# Custom sidebar templates, must be a dictionary that maps document names
87+
# to template names.
88+
#
89+
# The default sidebars (for documents that don't match any pattern) are
90+
# defined by theme itself. Builtin themes are using these templates by
91+
# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
92+
# 'searchbox.html']``.
93+
#
94+
# html_sidebars = {}
95+
96+
97+
# -- Functions: `setup`, docstring preprocessing, etc. -----------------------
98+
99+
def setup(app):
100+
"""Prepare the Sphinx application object.
101+
102+
Used for providing a custom CSS file for override styles.
103+
104+
Parameters
105+
----------
106+
app : object
107+
The Sphinx application object.
108+
109+
Returns
110+
-------
111+
app : object
112+
The Sphinx application object.
113+
114+
"""
115+
app.add_stylesheet('css/custom.css')
116+
return app

0 commit comments

Comments
 (0)