Skip to content

Commit

Permalink
docs: Get tags on readthedocs.
Browse files Browse the repository at this point in the history
Makes `git describe` work so we get the correct version information.

Signed-off-by: Tim 'mithro' Ansell <me@mith.ro>
  • Loading branch information
mithro committed Apr 4, 2019
1 parent 817aee8 commit 5951814
Showing 1 changed file with 25 additions and 17 deletions.
42 changes: 25 additions & 17 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,31 @@
copyright = u'2018, SymbiFlow Team'
author = u'SymbiFlow Team'

# Enable github links when not on readthedocs
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
if not on_rtd:
html_context = {
"display_github": True, # Integrate GitHub
"github_user": "symbiflow", # Username
"github_repo": "prjxray", # Repo name
"github_version": "master", # Version
"conf_py_path": "/doc/",
}
else:
import subprocess
subprocess.check(
'git fetch origin --unshallow',
cwd=os.path.abspath(os.path.dirname(__file__)),
shell=True)
subprocess.check(
'git fetch origin --tags',
cwd=os.path.abspath(os.path.dirname(__file__)),
shell=True)
subprocess.check_call(
'make links',
cwd=os.path.abspath(os.path.dirname(__file__)),
shell=True)

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
Expand Down Expand Up @@ -103,23 +128,6 @@
#
# html_theme_options = {}

# Enable github links when not on readthedocs
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
if not on_rtd:
html_context = {
"display_github": True, # Integrate GitHub
"github_user": "symbiflow", # Username
"github_repo": "prjxray", # Repo name
"github_version": "master", # Version
"conf_py_path": "/doc/",
}
else:
import subprocess
subprocess.check_call(
'make links',
cwd=os.path.abspath(os.path.dirname(__file__)),
shell=True)


# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
Expand Down

0 comments on commit 5951814

Please sign in to comment.