diff --git a/docs/_static/custom.css b/docs/_static/custom.css new file mode 100644 index 000000000000..3d0319dd337c --- /dev/null +++ b/docs/_static/custom.css @@ -0,0 +1,16 @@ +@import url('https://fonts.googleapis.com/css?family=Roboto|Roboto+Mono'); + +@media screen and (min-width: 1080px) { + div.document { + width: 1040px; + } +} + +code.descname { + color: #4885ed; +} + +th.field-name { + min-width: 100px; + color: #3cba54; +} diff --git a/docs/conf.py b/docs/conf.py index 89c2cb7a3d3b..8aa99a9753de 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -23,21 +23,14 @@ # All configuration values have a default; values that are commented out # serve to show the default. -from email import message_from_string +import email import os -from pkg_resources import get_distribution -import sys -import urllib - -import sphinx_rtd_theme - - -ON_READ_THE_DOCS = os.environ.get('READTHEDOCS', None) == 'True' +import pkg_resources # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. -sys.path.insert(0, os.path.abspath('..')) +# sys.path.insert(0, os.path.abspath('..')) # -- General configuration ----------------------------------------------------- @@ -77,7 +70,7 @@ # built documents. # # The short X.Y version. -distro = get_distribution('google-cloud') +distro = pkg_resources.get_distribution('google-cloud') release = os.getenv('SPHINX_RELEASE', distro.version) # The language for content autogenerated by Sphinx. Refer to documentation @@ -119,15 +112,21 @@ # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. - -if not ON_READ_THE_DOCS: - html_theme = 'sphinx_rtd_theme' - html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] +html_theme = 'alabaster' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. -#html_theme_options = {} +html_theme_options = { + 'description': 'Google Cloud Client Libraries for Python', + 'github_user': 'GoogleCloudPlatform', + 'github_repo': 'google-cloud-python', + 'github_banner': True, + 'travis_button': True, + 'font_family': "'Roboto', Georgia, sans", + 'head_font_family': "'Roboto', Georgia, serif", + 'code_font_family': "'Roboto Mono', 'Consolas', monospace", +} # Add any paths that contain custom themes here, relative to this directory. #html_theme_path = [] @@ -164,7 +163,14 @@ #html_use_smartypants = True # Custom sidebar templates, maps document names to template names. -#html_sidebars = {} +html_sidebars = { + '**': [ + 'about.html', + 'navigation.html', + 'relations.html', + 'searchbox.html', + ] +} # Additional templates that should be rendered to pages, maps page names to # template names. @@ -216,7 +222,7 @@ } metadata = distro.get_metadata(distro.PKG_INFO) -author = message_from_string(metadata).get('Author') +author = email.message_from_string(metadata).get('Author') # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass [howto/manual]). latex_documents = [