Explorar el Código

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
Krzysztof hace 9 años
padre
commit
adca98348e
Se han modificado 1 ficheros con 17 adiciones y 7 borrados
  1. 17 7
      docs/conf.py

+ 17 - 7
docs/conf.py

@@ -75,13 +75,23 @@ copyright = u'2016, Espressif'
 # |version| and |release|, also used in various other places throughout the
 # |version| and |release|, also used in various other places throughout the
 # built documents.
 # 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
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.
 # for a list of supported languages.