Merge branch 'doc/view_github_link' into 'master'

docs: add 'edit-on-github' link to html theme

Closes IDF-1504

See merge request espressif/esp-idf!8629
This commit is contained in:
Krzysztof Budzynski
2020-05-25 03:21:23 +08:00
3 changed files with 33 additions and 13 deletions

View File

@@ -8,19 +8,7 @@ import subprocess
from docutils import nodes
from collections import namedtuple
from sphinx.transforms.post_transforms import SphinxPostTransform
def get_github_rev():
path = subprocess.check_output(['git', 'rev-parse', '--short', 'HEAD']).strip().decode('utf-8')
try:
tag = subprocess.check_output(['git', 'describe', '--exact-match']).strip().decode('utf-8')
except subprocess.CalledProcessError:
tag = None
print('Git commit ID: ', path)
if tag:
print('Git tag: ', tag)
return tag
return path
from get_github_rev import get_github_rev
# Creates a dict of all submodules with the format {submodule_path : (url relative to git root), commit)}