Skip to content

Commit f29abec

Browse files
author
Jon Wayne Parrott
authored
Use alabaster theme (#3496)
1 parent 62598f4 commit f29abec

File tree

2 files changed

+40
-18
lines changed

2 files changed

+40
-18
lines changed

docs/_static/custom.css

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
@import url('https://fonts.googleapis.com/css?family=Roboto|Roboto+Mono');
2+
3+
@media screen and (min-width: 1080px) {
4+
div.document {
5+
width: 1040px;
6+
}
7+
}
8+
9+
code.descname {
10+
color: #4885ed;
11+
}
12+
13+
th.field-name {
14+
min-width: 100px;
15+
color: #3cba54;
16+
}

docs/conf.py

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,14 @@
2323
# All configuration values have a default; values that are commented out
2424
# serve to show the default.
2525

26-
from email import message_from_string
26+
import email
2727
import os
28-
from pkg_resources import get_distribution
29-
import sys
30-
import urllib
31-
32-
import sphinx_rtd_theme
33-
34-
35-
ON_READ_THE_DOCS = os.environ.get('READTHEDOCS', None) == 'True'
28+
import pkg_resources
3629

3730
# If extensions (or modules to document with autodoc) are in another directory,
3831
# add these directories to sys.path here. If the directory is relative to the
3932
# documentation root, use os.path.abspath to make it absolute, like shown here.
40-
sys.path.insert(0, os.path.abspath('..'))
33+
# sys.path.insert(0, os.path.abspath('..'))
4134

4235
# -- General configuration -----------------------------------------------------
4336

@@ -77,7 +70,7 @@
7770
# built documents.
7871
#
7972
# The short X.Y version.
80-
distro = get_distribution('google-cloud')
73+
distro = pkg_resources.get_distribution('google-cloud')
8174
release = os.getenv('SPHINX_RELEASE', distro.version)
8275

8376
# The language for content autogenerated by Sphinx. Refer to documentation
@@ -119,15 +112,21 @@
119112

120113
# The theme to use for HTML and HTML Help pages. See the documentation for
121114
# a list of builtin themes.
122-
123-
if not ON_READ_THE_DOCS:
124-
html_theme = 'sphinx_rtd_theme'
125-
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
115+
html_theme = 'alabaster'
126116

127117
# Theme options are theme-specific and customize the look and feel of a theme
128118
# further. For a list of options available for each theme, see the
129119
# documentation.
130-
#html_theme_options = {}
120+
html_theme_options = {
121+
'description': 'Google Cloud Client Libraries for Python',
122+
'github_user': 'GoogleCloudPlatform',
123+
'github_repo': 'google-cloud-python',
124+
'github_banner': True,
125+
'travis_button': True,
126+
'font_family': "'Roboto', Georgia, sans",
127+
'head_font_family': "'Roboto', Georgia, serif",
128+
'code_font_family': "'Roboto Mono', 'Consolas', monospace",
129+
}
131130

132131
# Add any paths that contain custom themes here, relative to this directory.
133132
#html_theme_path = []
@@ -164,7 +163,14 @@
164163
#html_use_smartypants = True
165164

166165
# Custom sidebar templates, maps document names to template names.
167-
#html_sidebars = {}
166+
html_sidebars = {
167+
'**': [
168+
'about.html',
169+
'navigation.html',
170+
'relations.html',
171+
'searchbox.html',
172+
]
173+
}
168174

169175
# Additional templates that should be rendered to pages, maps page names to
170176
# template names.
@@ -216,7 +222,7 @@
216222
}
217223

218224
metadata = distro.get_metadata(distro.PKG_INFO)
219-
author = message_from_string(metadata).get('Author')
225+
author = email.message_from_string(metadata).get('Author')
220226
# Grouping the document tree into LaTeX files. List of tuples
221227
# (source start file, target name, title, author, documentclass [howto/manual]).
222228
latex_documents = [

0 commit comments

Comments
 (0)