All of lore.kernel.org
 help / color / mirror / Atom feed
From: John McNamara <john.mcnamara@intel.com>
To: dev@dpdk.org
Cc: John McNamara <john.mcnamara@intel.com>
Subject: [PATCH v1] doc: import sphinx rtd doc theme when available
Date: Fri, 23 Jun 2017 14:05:29 +0100	[thread overview]
Message-ID: <1498223129-28590-1-git-send-email-john.mcnamara@intel.com> (raw)

The ReadTheDocs theme is no longer available by default in
Sphinx versions >= 1.3.1 and if it isn't available then an
exception is raised. This patch imports the ReadTheDocs
theme when it is available and warns but proceeds when it
isn't.

Signed-off-by: John McNamara <john.mcnamara@intel.com>
---
 doc/guides/conf.py | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/doc/guides/conf.py b/doc/guides/conf.py
index c3cd0bd..3988075 100644
--- a/doc/guides/conf.py
+++ b/doc/guides/conf.py
@@ -47,11 +47,17 @@
     # Python 3.
     import configparser
 
+try:
+    import sphinx_rtd_theme
 
-project = 'Data Plane Development Kit'
-
-if LooseVersion(sphinx_version) >= LooseVersion('1.3.1'):
     html_theme = "sphinx_rtd_theme"
+    html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
+except:
+    print('Install the sphinx ReadTheDocs theme for improved html documentation '
+          'layout: pip install sphinx_rtd_theme')
+    pass
+
+project = 'Data Plane Development Kit'
 html_logo = '../logo/DPDK_logo_vertical_rev_small.png'
 latex_logo = '../logo/DPDK_logo_horizontal_tag.png'
 html_add_permalinks = ""
-- 
2.7.4

             reply	other threads:[~2017-06-23 13:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-23 13:05 John McNamara [this message]
2017-07-09 21:22 ` [PATCH v1] doc: import sphinx rtd doc theme when available Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1498223129-28590-1-git-send-email-john.mcnamara@intel.com \
    --to=john.mcnamara@intel.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.