From cb541e28ad78127f0fb0bebd256067e15d79e306 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner <inform@tiker.net> Date: Mon, 29 Apr 2013 10:57:29 -0400 Subject: [PATCH] Switch doc theme to Bootstrap. --- doc/source/_static/akdoc.css | 53 +++++++++++++++++++++++++++++++ doc/source/_templates/layout.html | 2 ++ doc/source/conf.py | 25 +++++++++++++-- 3 files changed, 77 insertions(+), 3 deletions(-) create mode 100644 doc/source/_static/akdoc.css create mode 100644 doc/source/_templates/layout.html diff --git a/doc/source/_static/akdoc.css b/doc/source/_static/akdoc.css new file mode 100644 index 00000000..c78ea20f --- /dev/null +++ b/doc/source/_static/akdoc.css @@ -0,0 +1,53 @@ +pre { + line-height: 100%; +} + +.footer { + background-color: #eee; +} + +body > div.container { + margin-top:10px; +} + +dd { + margin-left: 40px; +} + +tt.descname { + font-size: 100%; +} + +code { + color: rgb(51,51,51); +} + +h1 { + padding-bottom:5px; + border-bottom: 1px solid #ccc; +} + +h2 { + padding-bottom:1px; + border-bottom: 1px solid #ccc; +} + +h3 { + padding-bottom:1px; + border-bottom: 1px solid #ccc; +} + +.rubric { + font-size: 120%; + padding-bottom:1px; + border-bottom: 1px solid #ccc; +} + +.headerlink { + padding-left: 1ex; + padding-right: 1ex; +} + +a.headerlink:hover { + text-decoration: none; +} diff --git a/doc/source/_templates/layout.html b/doc/source/_templates/layout.html new file mode 100644 index 00000000..0fed238f --- /dev/null +++ b/doc/source/_templates/layout.html @@ -0,0 +1,2 @@ +{% extends "!layout.html" %} +{% set css_files = css_files + ['_static/akdoc.css']%} diff --git a/doc/source/conf.py b/doc/source/conf.py index ccfb977b..dc61cda2 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -29,7 +29,7 @@ extensions = [ ] # Add any paths that contain templates here, relative to this directory. -templates_path = ['.templates'] +templates_path = ['_templates'] exclude_patterns = ['subst.rst'] @@ -84,10 +84,29 @@ pygments_style = 'sphinx' # Options for HTML output # ----------------------- +try: + import sphinx_bootstrap_theme +except: + from warnings import warn + warn("I would like to use the sphinx bootstrap theme, but can't find it.\n" + "'pip install sphinx_bootstrap_theme' to fix.") +else: + # Activate the theme. + html_theme = 'bootstrap' + html_theme_path = sphinx_bootstrap_theme.get_html_theme_path() + + # 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 = { + 'navbar_fixed_top': "true", + 'navbar_class': "navbar navbar-inverse", + } + # The style sheet to use for HTML and HTML Help pages. A file of that name # must exist either in Sphinx' static/ path, or in one of the custom paths # given in html_static_path. -html_style = 'default.css' +#html_style = 'default.css' # The name for this set of Sphinx documents. If None, it defaults to # "<project> v<release> documentation". @@ -100,7 +119,7 @@ html_style = 'default.css' # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['.static'] +html_static_path = ['_static'] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. -- GitLab