8000 Include default rcparam in rc role, flake · matplotlib/matplotlib@75ce592 · GitHub
[go: up one dir, main page]

Skip to content

Commit 75ce592

Browse files
Include default rcparam in rc role, flake
1 parent 27ce832 commit 75ce592

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

doc/sphinxext/custom_roles.py

Lines changed: 2 additions & 6 deletions
Diff line change
Original file line numberDiff line number
@@ -2,14 +2,10 @@
22
from os.path import sep
33
from matplotlib import rcParamsDefault
44

5+
56
def rcparam_role(name, rawtext, text, lineno, inliner, options={}, content=[]):
6-
77
param = rcParamsDefault.get(text)
8-
if isinstance(param, str):
9-
txt = f' : "{param}"'
10-
else:
11-
txt = f' : {param}'
12-
rendered = nodes.Text(f'rcParams["{text}"]' + txt)
8+
rendered = nodes.Text(f'rcParams["{text}"] = {param!r}')
139

1410
source = inliner.document.attributes['source'].replace(sep, '/')
1511
rel_source = source.split('/doc/', 1)[1]

0 commit comments

Comments
 (0)
0