From adca98348ea3ffb110764e5fc1801ace643ce700 Mon Sep 17 00:00:00 2001 From: Krzysztof Date: Sat, 5 Nov 2016 17:11:40 +0100 Subject: [PATCH] Resolved issue with version / release on Read the Docs Read the Docs is building documentation referencing to specific releases on GitHub. Changing version / release in this script is breaking menu in bottom left corner Now version / release should change only for local builds and not for builds on Read the Docs --- docs/conf.py | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 8a4a275c8a..494ab3cf7f 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -75,13 +75,23 @@ copyright = u'2016, Espressif' # |version| and |release|, also used in various other places throughout the # built documents. # -# This is supposed to be "the short X.Y version", but it's the only version -# visible when you open index.html. -# Display full version to make things less confusing. -# If needed, nearest tag is returned by 'git describe --abbrev=0'. -version = run_cmd_get_output('git describe') -# The full version, including alpha/beta/rc tags. -release = run_cmd_get_output('git describe') + +# Different setup depending if script is running on ReadTheDocs or elsewhere +on_rtd = os.environ.get('READTHEDOCS') == 'True' +if on_rtd: + # The short X.Y version. + # Apparently ReadTheDocs is getting confused by other version / release + # ReadTheDocs is building specific or the latest release from GitHub. + version = '1.0' + release = '1.0' +else: + # This is supposed to be "the short X.Y version", but it's the only version + # visible when you open index.html. + # Display full version to make things less confusing. + # If needed, nearest tag is returned by 'git describe --abbrev=0'. + version = run_cmd_get_output('git describe') + # The full version, including alpha/beta/rc tags. + release = run_cmd_get_output('git describe') # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. -- 2.40.0