From 687435cc965acadc4ad2068244f1548df47a6b6d Mon Sep 17 00:00:00 2001 From: Jeppe Klitgaard Date: Wed, 1 Apr 2015 20:00:51 +0200 Subject: [PATCH] Docs now automatically figure out the pyCraft version. Docs now also use the RTD theme when compiling locally. --- docs/conf.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index e84a083..0d319f4 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -63,10 +63,11 @@ author = u'Ammar Askar' # |version| and |release|, also used in various other places throughout the # built documents. # +import minecraft # The short X.Y version. -version = '0.01' +version = minecraft.__version__ # The full version, including alpha/beta/rc tags. -release = '0.01' +release = version # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. @@ -117,11 +118,12 @@ todo_include_todos = True # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. -on_rtd = os.environ.get('READTHEDOCS', None) == 'True' -if on_rtd: - html_theme = 'default' -else: - html_theme = 'alabaster' + +# Use RTD theme even when compiling locally. +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()] # 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