Skip to content

Commit

Permalink
Update :rc:
Browse files Browse the repository at this point in the history
  • Loading branch information
lukelbd committed Sep 16, 2019
1 parent 9a11f2e commit 3aacfa8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ lxml>=4.0.0
numpy>=1.14
ipython>=7.0.0
matplotlib>=3.0
git+https://github.com/lukelbd/sphinx-automodapi@v0.4.proplot-mods
git+https://github.com/lukelbd/sphinx-automodapi@v0.5.proplot-mods
6 changes: 4 additions & 2 deletions docs/sphinxext/custom_roles.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
def rcparam_role(name, rawtext, text, lineno, inliner, options={}, content=[]):
rendered = nodes.Text(f"rc['{text}']")
source = inliner.document.attributes['source'].replace(sep, '/')
relsource = source.split('/docs/', 1)[1]
levels = relsource.count('/') # distance to 'docs' folder
relsource = source.split('/docs/', 1)
if len(relsource) == 1:
return [], []
levels = relsource[1].count('/') # distance to 'docs' folder
refuri = ('../' * levels) + 'en/latest/rctools.html?highlight=' + text

ref = nodes.reference(rawtext, rendered, refuri=refuri)
Expand Down

0 comments on commit 3aacfa8

Please sign in to comment.