From 5c8398da0590e495739ec31fb6d19a0c4a5d99ed Mon Sep 17 00:00:00 2001 From: "David B. Kinder" Date: Fri, 3 Aug 2018 16:12:03 -0700 Subject: [PATCH] doc: switch to use RTD theme This PR removes use of the customized zephyr_docs_theme, replacing it with the new read_the_docs theme. It ignores the tags that were previously used to switch the theme for "development" vs. "daily" or "release" and always uses the RTD theme. (The "daily" vs. "release" is still honored to change the breadcrumb and doc version to "latest" if "daily" is specified (as we did for the current doc build process), otherwise it uses the version extracted from the VERSION file in the source code (as would be appropriate for the docs for a tagged release.) This also pulls in using template extensions for breadcrumb and the notice about latest having more up-to-date content when the "release" tag is set. Signed-off-by: David B. Kinder --- doc/_templates/breadcrumbs.html | 14 ++++++++++++++ doc/_templates/layout.html | 10 ++++++++++ doc/conf.py | 16 +++------------- 3 files changed, 27 insertions(+), 13 deletions(-) create mode 100644 doc/_templates/breadcrumbs.html create mode 100644 doc/_templates/layout.html diff --git a/doc/_templates/breadcrumbs.html b/doc/_templates/breadcrumbs.html new file mode 100644 index 00000000000..6c6493a1c1d --- /dev/null +++ b/doc/_templates/breadcrumbs.html @@ -0,0 +1,14 @@ +{% extends "!breadcrumbs.html" %} +{% block breadcrumbs %} + + {# parameterize default name "Docs" in breadcrumb via docs_title in conf.py #} + {% if not docs_title %} + {% set docs_title = "Docs" %} + {% endif %} + +
  • {{ docs_title }} »
  • + {% for doc in parents %} +
  • {{ doc.title }} »
  • + {% endfor %} +
  • {{ title }}
  • +{% endblock %} diff --git a/doc/_templates/layout.html b/doc/_templates/layout.html new file mode 100644 index 00000000000..b6894ee4ef1 --- /dev/null +++ b/doc/_templates/layout.html @@ -0,0 +1,10 @@ +{% extends "!layout.html" %} +{% block document %} + {% if is_release %} +
    + The latest development version + of this page may be more current than this released {{ version }} version. +
    + {% endif %} + {{ super() }} +{% endblock %} diff --git a/doc/conf.py b/doc/conf.py index 474e42dc179..6466850bcc5 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -149,19 +149,9 @@ rst_epilog = """ # -- Options for HTML output ---------------------------------------------- -try: - import sphinx_rtd_theme -except ImportError: - html_theme = 'zephyr' - html_theme_path = ['{}/doc/themes'.format(ZEPHYR_BASE)] -else: - html_theme = "sphinx_rtd_theme" - html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] - -if tags.has('daily') or tags.has('release'): - html_theme = 'zephyr-docs-theme' - html_theme_path = ['{}/doc/themes'.format(ZEPHYR_BASE)] - +import sphinx_rtd_theme +html_theme = "sphinx_rtd_theme" +html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] if tags.has('release'): is_release = True