Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4aec12b

Browse files
authored
Merge pull request #11491 from fredrik-1/rc_role_windows
DOC: Fixed the source path on windows in rcparam_role
2 parents fae6a33 + e75daca commit 4aec12b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

doc/sphinxext/custom_roles.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
from docutils import nodes
2+
from os.path import sep
23

34

45
def rcparam_role(name, rawtext, text, lineno, inliner, options={}, content=[]):
56
rendered = nodes.Text('rcParams["{}"]'.format(text))
67

7-
rel_source = inliner.document.attributes['source'].split('/doc/', 1)[1]
8+
source = inliner.document.attributes['source'].replace(sep, '/')
9+
rel_source = source.split('/doc/', 1)[1]
10+
811
levels = rel_source.count('/')
912
refuri = ('../' * levels +
1013
'tutorials/introductory/customizing.html#matplotlib-rcparams')

0 commit comments

Comments
 (0)