Skip to content

Commit 34fa80a

Browse files
committed
Merge pull request #119 from ddemidov/docs-theme
Switch to bootstrap theme for documentation
2 parents ea4ba43 + d0a3bad commit 34fa80a

File tree

4 files changed

+33
-20
lines changed

4 files changed

+33
-20
lines changed

docs/_static/custom.css

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
pre {
2+
box-shadow: 0px 1px 6px 0px lightgray;
3+
}
4+
5+
dl.class {
6+
padding: 5px;
7+
box-shadow: 0px 1px 6px 0px lightgray;
8+
}
9+
10+
pre {
11+
overflow: auto;
12+
word-wrap: normal;
13+
white-space: pre;
14+
}

docs/_static/theme_overrides.css

Lines changed: 0 additions & 14 deletions
This file was deleted.

docs/_templates/page.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{# Import the theme's layout. #}
2+
{% extends "!page.html" %}
3+
4+
{# Custom CSS overrides #}
5+
{% set bootswatch_css_custom = ['_static/custom.css'] %}

docs/conf.py

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@
2222

2323
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
2424

25+
if on_rtd:
26+
import pip
27+
pip.main(['install', 'sphinx_bootstrap_theme'])
28+
29+
import sphinx_bootstrap_theme
30+
2531
# If extensions (or modules to document with autodoc) are in another directory,
2632
# add these directories to sys.path here. If the directory is relative to the
2733
# documentation root, use os.path.abspath to make it absolute, like shown here.
@@ -117,12 +123,14 @@
117123

118124
# The theme to use for HTML and HTML Help pages. See the documentation for
119125
# a list of builtin themes.
120-
if not on_rtd:
121-
html_theme = 'sphinx_rtd_theme'
122-
123-
def setup(app):
124-
# overrides for wide tables in RTD theme
125-
app.add_stylesheet('theme_overrides.css')
126+
html_theme_path = sphinx_bootstrap_theme.get_html_theme_path()
127+
html_theme = 'bootstrap'
128+
html_theme_options = {
129+
'bootswatch_theme': 'yeti',
130+
'navbar_links' : [
131+
("GitHub", "https://github.com/rhempel/ev3dev-lang-python", True)
132+
]
133+
}
126134

127135
# Theme options are theme-specific and customize the look and feel of a theme
128136
# further. For a list of options available for each theme, see the

0 commit comments

Comments
 (0)