Skip to content

Commit

Permalink
Direct :rc: links to .proplotrc file header
Browse files Browse the repository at this point in the history
  • Loading branch information
lukelbd committed Sep 16, 2019
1 parent 4824c4b commit ad8617f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/sphinxext/custom_roles.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ def rc_role(name, rawtext, text, lineno, inliner, options={}, content=[]):
if len(relsource) == 1:
return [], []
levels = relsource[1].count('/') # distance to 'docs' folder
refuri = ('../' * levels) + 'en/latest/rctools.html?highlight=' + text
refuri = ('../' * levels +
f'en/latest/rctools.html?highlight={text}#.proplotrc-file')

ref = nodes.reference(rawtext, rendered, refuri=refuri)
node_list = [nodes.literal('', '', ref)]
Expand Down

0 comments on commit ad8617f

Please sign in to comment.