Skip to content

Commit

Permalink
Fix the broken release links to include the v [ci skip]
Browse files Browse the repository at this point in the history
Our tag names start with v, but the default for releases is to not use a v.
  • Loading branch information
eric-wieser committed May 27, 2020
1 parent 8cb0849 commit 0c726f0
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
15 changes: 15 additions & 0 deletions doc/_sphinxext/releases_hack.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
"""
Workaround for https://github.com/bitprophet/releases/issues/65
This has to be in its own file, as for some reason classes in conf.py cannot
be pickled.
"""

class release_uri:
def __init__(self, releases_github_path):
self._path = releases_github_path

def __mod__(self, release):
if release.isdigit():
release = "v" + release
return 'https://github.com/%s/tree/%s' % (self._path, release)
9 changes: 6 additions & 3 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,16 @@
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))
import os
import sys
sys.path.append(os.path.abspath('_sphinxext'))


# -- Imports

import sphinx_rtd_theme
import sphinx
import releases_hack

# -- Project information -----------------------------------------------------

Expand Down Expand Up @@ -206,6 +208,7 @@ def add_source_parser(_old_add_source_parser, self, *args, **kwargs):
# to e.g. account/project. Releases will then use an appropriate Github URL for both
# releases and issues.
releases_github_path = 'pygae/galgebra'
releases_release_uri = releases_hack.release_uri(releases_github_path)

# You may optionally set releases_debug = True to see debug output while building your docs.
releases_debug = True
Expand Down

0 comments on commit 0c726f0

Please sign in to comment.