8000 highlight rcparams · matplotlib/matplotlib@bd642cf · GitHub
[go: up one dir, main page]

Skip to content

Commit bd642cf

Browse files
highlight rcparams
1 parent 7c816c5 commit bd642cf

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ Thumbs.db
5656
###################################
5757
lib/matplotlib/mpl-data/matplotlib.conf
5858
lib/matplotlib/mpl-data/matplotlibrc
59+
tutorials/intermediate/CL01.png
60+
tutorials/intermediate/CL02.png
5961

6062
# Documentation generated files #
6163
#################################

doc/_static/mpl.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -594,6 +594,10 @@ span.linkdescr {
594594
font-size: 90%;
595595
}
596596

597+
span.highlighted {
598+
background-color: #fce5a6;
599+
}
600+
597601
ul.search {
598602
margin: 10px 0 0 20px;
599603
padding: 0;

doc/sphinxext/custom_roles.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@
33

44

55
def rcparam_role(name, rawtext, text, lineno, inliner, options={}, content=[]):
6-
rendered = nodes.Text('rcParams["{}"]'.format(text))
6+
rendered = nodes.Text(f'rcParams["{text}"]')
77

88
source = inliner.document.attributes['source'].replace(sep, '/')
99
rel_source = source.split('/doc/', 1)[1]
1010

1111
levels = rel_source.count('/')
1212
refuri = ('../' * levels +
13-
'tutorials/introductory/customizing.html#matplotlib-rcparams')
13+
'tutorials/introductory/customizing.html' +
14+
f"?highlight={text}#a-sample-matplotlibrc-file")
1415

1516
ref = nodes.reference(rawtext, rendered, refuri=refuri)
1617
return [nodes.literal('', '', ref)], []

0 commit comments

Comments
 (0)
0