Switch to the readthedocs sphinx theme.

This commit is contained in:
Craig Citro
2015-01-06 00:17:23 -08:00
parent 96ab177b43
commit 9e4fe2f3bd
4 changed files with 14 additions and 37 deletions

View File

@@ -28,4 +28,4 @@ sphinx-apidoc -f -o docs/source oauth2client
cd docs
make html
cd ..
ghp-import -n docs/_build/html

View File

@@ -1,28 +0,0 @@
{% extends "!layout.html" %}
{# Custom CSS overrides #}
{# set bootswatch_css_custom = ['_static/my-styles.css'] #}
{# Add github banner (from: https://github.com/codepo8/css-fork-on-github-ribbon). #}
{% block header %}
{{ super() }}
<a href="https://github.com/google/oauth2client"
class="visible-desktop hidden-xs">
<img id="gh-banner"
style="position:absolute; right:0; border:0; width:149px; height:149px;"
src="http://aral.github.com/fork-me-on-github-retina-ribbons/right-grey@2x.png"
alt="Fork me on GitHub">
</a>
<script>
// Adjust banner height.
$(function () {
var navHeight = $(".navbar .container").css("height");
$("#gh-banner").css("top", navHeight);
var navZ = $(".container").css("z-index");
navZ = (navZ === "auto") ? 10 : navZ + 10;
$("#gh-banner").css("z-index", navZ);
});
</script>
{% endblock %}

View File

@@ -39,12 +39,11 @@ if django.VERSION[1] < 7:
# -- Options for HTML output ----------------------------------------------
import sphinx_bootstrap_theme
html_theme = 'bootstrap'
html_theme_path = sphinx_bootstrap_theme.get_html_theme_path()
html_theme_options = {
'bootswatch_theme': 'flatly',
}
# We want to set the RTD theme, but not if we're on RTD.
if os.environ.get('READTHEDOCS', '') != 'True':
import sphinx_rtd_theme
html_theme = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
html_static_path = ['_static']
html_logo = '_static/google_logo.png'

10
tox.ini
View File

@@ -40,13 +40,19 @@ deps =
basepython = python2.7
deps =
{[testenv:cover]deps}
ghp-import
python-gflags
pyyaml
sphinx
sphinx-bootstrap-theme
sphinx-rtd-theme
commands = ./doc-build
[testenv:pushdocs]
basepython = python2.7
deps =
{[testenv:docs]deps}
ghp-import
commands = ./push-docs
[testenv:py26]
basepython = python2.6
deps = {[testenv]basedeps}