From 0a4d4e30ef7e4aab981a109c19f029f4457c7309 Mon Sep 17 00:00:00 2001 From: Robert Jordens Date: Thu, 25 Aug 2016 21:52:46 +0200 Subject: [PATCH] doc: use sphinx_rtd_theme --- conda/artiq/meta.yaml | 1 + doc/manual/{static => _static}/WaveDrom.js | 0 doc/manual/{static => _static}/default.js | 0 doc/manual/_templates/layout.html | 14 ++++++++++++++ doc/manual/conf.py | 19 +++++++------------ setup.py | 2 +- 6 files changed, 23 insertions(+), 13 deletions(-) rename doc/manual/{static => _static}/WaveDrom.js (100%) rename doc/manual/{static => _static}/default.js (100%) create mode 100644 doc/manual/_templates/layout.html diff --git a/conda/artiq/meta.yaml b/conda/artiq/meta.yaml index c936cc246..ca300b8d3 100644 --- a/conda/artiq/meta.yaml +++ b/conda/artiq/meta.yaml @@ -28,6 +28,7 @@ requirements: - sphinx - sphinx-argparse - sphinxcontrib-wavedrom + - sphinx_rtd_theme - h5py - dateutil - pyqt5 diff --git a/doc/manual/static/WaveDrom.js b/doc/manual/_static/WaveDrom.js similarity index 100% rename from doc/manual/static/WaveDrom.js rename to doc/manual/_static/WaveDrom.js diff --git a/doc/manual/static/default.js b/doc/manual/_static/default.js similarity index 100% rename from doc/manual/static/default.js rename to doc/manual/_static/default.js diff --git a/doc/manual/_templates/layout.html b/doc/manual/_templates/layout.html new file mode 100644 index 000000000..1de6c4244 --- /dev/null +++ b/doc/manual/_templates/layout.html @@ -0,0 +1,14 @@ +{% extends "!layout.html" %} + +{# since sphinx_rtd_theme moves scripts to the end, hook up WaveDrom again #} +{%- block footer %} +{{ super() }} + +{% endblock %} diff --git a/doc/manual/conf.py b/doc/manual/conf.py index f936744dd..5719971e4 100644 --- a/doc/manual/conf.py +++ b/doc/manual/conf.py @@ -16,6 +16,7 @@ import sys import os +import sphinx_rtd_theme from unittest.mock import MagicMock @@ -124,24 +125,18 @@ pygments_style = 'sphinx' # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. -html_theme = 'classic' +html_theme = 'sphinx_rtd_theme' # 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 = { - 'sidebarbgcolor': '#171814', - 'sidebarlinkcolor': '#7389ae', - 'sidebartextcolor': '#b3b3bb', - 'footerbgcolor': '#171814', - 'footertextcolor': '#b3b3bb', - 'relbarbgcolor': '#171814', - 'relbarlinkcolor': '#7389ae', - 'relbartextcolor': '#b3b3bb', + 'analytics_id': 'UA-75602447-2', } # Add any paths that contain custom themes here, relative to this directory. #html_theme_path = [] +html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". @@ -152,7 +147,7 @@ html_theme_options = { # The name of an image file (relative to this directory) to place at the top # of the sidebar. -html_logo = "../logo/artiq_white.png" +html_logo = '../logo/artiq_white.png' # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 @@ -293,5 +288,5 @@ texinfo_documents = [ #texinfo_no_detailmenu = False # -- Options for sphinxcontrib-wavedrom ----------------------------------- -offline_skin_js_path = 'static/default.js' -offline_wavedrom_js_path = 'static/WaveDrom.js' +offline_skin_js_path = '_static/default.js' +offline_wavedrom_js_path = '_static/WaveDrom.js' diff --git a/setup.py b/setup.py index cef634160..c3c50e8c1 100755 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ if sys.version_info[:3] < (3, 5, 2): # Depends on PyQt5, but setuptools cannot check for it. requirements = [ - "sphinx", "sphinx-argparse", "sphinxcontrib-wavedrom", + "sphinx", "sphinx-argparse", "sphinxcontrib-wavedrom", "sphinx_rtd_theme", "asyncserial", "numpy", "scipy", "python-dateutil", "prettytable", "h5py", "quamash", "pyqtgraph", "pygit2", "aiohttp",