Skip to content

Commit 60c371f

Browse files
committed
Update example section titles
1 parent c4dae6f commit 60c371f

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

doc/conf.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@
115115
'subplots_axes_and_figures',
116116
'specialty_plots',
117117
'showcase',
118-
'reference',
119118
'api', 'pylab_examples',
120119
'mplot3d', 'axes_grid',
121120
'units', 'widgets')

doc/sphinxext/gen_gallery.py

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,19 @@
1111

1212
exclude_example_sections = ['units']
1313
multiimage = re.compile('(.*?)(_\d\d){1,2}')
14-
14+
custom_titles = {'pylab_examples' : 'pylab examples',
15+
'lines_bars_and_markers': 'Lines, bars, and markers',
16+
'shapes_and_collections': 'Shapes and collections',
17+
'statistics': 'Statistical plots',
18+
'images_contours_and_fields': 'Images, contours, and fields',
19+
'pie_and_polar_charts': 'Pie and polar charts',
20+
'text_labels_and_annotations': 'Text, labels, and annotations',
21+
'ticks_and_spines': 'Ticks and spines',
22+
'subplots_axes_and_figures': 'Subplots, axes, and figures',
23+
'specialty_plots': 'Specialty plots',
24+
'showcase': 'Showcase',
25+
'api': 'API',
26+
}
1527

1628
# generate a thumbnail gallery of examples
1729
gallery_template = """\
@@ -46,10 +58,7 @@
4658
"""
4759

4860
toc_template = """\
49-
<li><a class="reference internal" href="#{section}">{section}</a></li>"""
50-
51-
52-
custom_titles = {'pylab_examples' : 'pylab examples'}
61+
<li><a class="reference internal" href="#{section}">{title}</a></li>"""
5362

5463

5564
def make_thumbnail(args):
@@ -89,7 +98,7 @@ def gen_gallery(app, doctree):
8998
for subdir in example_sections:
9099
title = custom_titles.get(subdir, subdir)
91100
rows.append(header_template.format(title=title, section=subdir))
92-
toc_rows.append(toc_template.format(section=subdir))
101+
toc_rows.append(toc_template.format(title=title, section=subdir))
93102

94103
origdir = os.path.join('build', rootdir, subdir)
95104
thumbdir = os.path.join(outdir, rootdir, subdir, 'thumbnails')

0 commit comments

Comments
 (0)