Skip to content

Commit 8541fab

Browse files
neerajpradjpchen
authored andcommitted
Customize read the docs theme for Pyro (pyro-ppl#446)
* Customize read the docs theme for Pyro * Format using yapf, isort * fix format
1 parent 73a4feb commit 8541fab

File tree

6 files changed

+33
-29
lines changed

6 files changed

+33
-29
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ scrub: FORCE
1818
find tutorial -name "*.ipynb" | xargs python -m nbstripout
1919

2020
format: FORCE
21-
yapf -i *.py pyro/distributions/*.py
22-
isort --recursive *.py pyro/ tests/
21+
yapf -i *.py pyro/distributions/*.py docs/source/conf.py
22+
isort --recursive *.py pyro/ tests/ docs/source/conf.py
2323

2424
test: lint docs FORCE
2525
pytest -vx -n auto --stage unit

docs/source/_static/css/pyro.css

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
@import url("theme.css");
2+
3+
.wy-side-nav-search {
4+
background-color: #dddddd;
5+
}
6+
7+
.wy-side-nav-search a {
8+
margin: 0
9+
}
10+
11+
.wy-side-nav-search > div.version {
12+
color: #000000;
13+
}
File renamed without changes.
File renamed without changes.
5.43 KB
Loading

docs/source/conf.py

Lines changed: 18 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import sphinx_rtd_theme
22

3+
import pkg_resources
4+
35
# -*- coding: utf-8 -*-
46
#
57
# Pyro documentation build configuration file, created by
@@ -22,7 +24,6 @@
2224
# import sys
2325
# sys.path.insert(0, os.path.abspath('.'))
2426

25-
2627
# -- General configuration ------------------------------------------------
2728

2829
# If your documentation needs a minimal Sphinx version, state it here.
@@ -32,14 +33,15 @@
3233
# Add any Sphinx extension module names here, as strings. They can be
3334
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
3435
# ones.
35-
extensions = ['sphinx.ext.intersphinx',
36-
'sphinx.ext.todo',
37-
'sphinx.ext.mathjax',
38-
'sphinx.ext.ifconfig',
39-
'sphinx.ext.viewcode',
40-
'sphinx.ext.githubpages',
41-
'sphinx.ext.autodoc'
42-
]
36+
extensions = [
37+
'sphinx.ext.intersphinx', #
38+
'sphinx.ext.todo', #
39+
'sphinx.ext.mathjax', #
40+
'sphinx.ext.ifconfig', #
41+
'sphinx.ext.viewcode', #
42+
'sphinx.ext.githubpages', #
43+
'sphinx.ext.autodoc',
44+
]
4345

4446
# Add any paths that contain templates here, relative to this directory.
4547
templates_path = ['_templates']
@@ -63,7 +65,7 @@
6365
# built documents.
6466
#
6567
# The short X.Y version.
66-
version = u'0.0.1'
68+
version = pkg_resources.require('pyro-ppl')[0].version
6769
# The full version, including alpha/beta/rc tags.
6870
release = u'0.0.1'
6971

@@ -91,7 +93,7 @@
9193
# -- Options for HTML output ----------------------------------------------
9294

9395
# logo
94-
html_logo = '../img/pyro_logo_small.png'
96+
html_logo = '_static/img/pyro_logo_wide.png'
9597

9698
# The theme to use for HTML and HTML Help pages. See the documentation for
9799
# a list of builtin themes.
@@ -111,15 +113,14 @@
111113
# Add any paths that contain custom static files (such as style sheets) here,
112114
# relative to this directory. They are copied after the builtin static files,
113115
# so a file named "default.css" will overwrite the builtin "default.css".
114-
html_static_path = []
115-
116+
html_static_path = ['_static']
117+
html_style = 'css/pyro.css'
116118

117119
# -- Options for HTMLHelp output ------------------------------------------
118120

119121
# Output file base name for HTML help builder.
120122
htmlhelp_basename = 'Pyrodoc'
121123

122-
123124
# -- Options for LaTeX output ---------------------------------------------
124125

125126
latex_elements = {
@@ -144,37 +145,27 @@
144145
# (source start file, target name, title,
145146
# author, documentclass [howto, manual, or own class]).
146147
latex_documents = [
147-
(master_doc, 'Pyro.tex', u'Pyro Documentation',
148-
u'Uber AI Labs', 'manual'),
148+
(master_doc, 'Pyro.tex', u'Pyro Documentation', u'Uber AI Labs', 'manual'),
149149
]
150150

151-
152151
# -- Options for manual page output ---------------------------------------
153152

154153
# One entry per manual page. List of tuples
155154
# (source start file, name, description, authors, manual section).
156-
man_pages = [
157-
(master_doc, 'pyro', u'Pyro Documentation',
158-
[author], 1)
159-
]
160-
155+
man_pages = [(master_doc, 'pyro', u'Pyro Documentation', [author], 1)]
161156

162157
# -- Options for Texinfo output -------------------------------------------
163158

164159
# Grouping the document tree into Texinfo files. List of tuples
165160
# (source start file, target name, title, author,
166161
# dir menu entry, description, category)
167162
texinfo_documents = [
168-
(master_doc, 'Pyro', u'Pyro Documentation',
169-
author, 'Pyro', 'One line description of project.',
170-
'Miscellaneous'),
163+
(master_doc, 'Pyro', u'Pyro Documentation', author, 'Pyro', 'One line description of project.', 'Miscellaneous'),
171164
]
172165

173-
174166
# Example configuration for intersphinx: refer to the Python standard library.
175167
intersphinx_mapping = {'https://docs.python.org/': None}
176168

177-
178169
# document class constructors (__init__ methods):
179170
""" comment out this functionality for now;
180171
def skip(app, what, name, obj, skip, options):

0 commit comments

Comments
 (0)