Skip to content

Commit 8c270a2

Browse files
authored
Bump to sphinx-gallery>=0.19 and use list in subsection_order and string in within_subsection_order (#3805)
* Use plain list in sphinx-gallery subsection_order and within_subsection_order * Bump sphinx-gallery>=0.19
1 parent f80a229 commit 8c270a2

File tree

2 files changed

+22
-25
lines changed

2 files changed

+22
-25
lines changed

doc/conf.py

Lines changed: 21 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
from pygmt import __commit__, __version__
1010
from pygmt.clib import required_gmt_version
1111
from pygmt.sphinx_gallery import PyGMTScraper
12-
from sphinx_gallery.sorting import ExampleTitleSortKey, ExplicitOrder
1312

1413
# Dictionary for dependency name and minimum required versions
1514
requirements = {
@@ -112,34 +111,32 @@
112111
],
113112
# Set paths where to save the generated examples
114113
"gallery_dirs": ["intro", "tutorials", "gallery", "projections"],
115-
"subsection_order": ExplicitOrder(
116-
[
117-
"../examples/intro",
118-
"../examples/tutorials/basics",
119-
"../examples/tutorials/advanced",
120-
"../examples/gallery/maps",
121-
"../examples/gallery/lines",
122-
"../examples/gallery/symbols",
123-
"../examples/gallery/images",
124-
"../examples/gallery/3d_plots",
125-
"../examples/gallery/seismology",
126-
"../examples/gallery/basemaps",
127-
"../examples/gallery/histograms",
128-
"../examples/gallery/embellishments",
129-
"../examples/projections/azim",
130-
"../examples/projections/conic",
131-
"../examples/projections/cyl",
132-
"../examples/projections/misc",
133-
"../examples/projections/nongeo",
134-
"../examples/projections/table",
135-
]
136-
),
114+
"subsection_order": [
115+
"../examples/intro",
116+
"../examples/tutorials/basics",
117+
"../examples/tutorials/advanced",
118+
"../examples/gallery/maps",
119+
"../examples/gallery/lines",
120+
"../examples/gallery/symbols",
121+
"../examples/gallery/images",
122+
"../examples/gallery/3d_plots",
123+
"../examples/gallery/seismology",
124+
"../examples/gallery/basemaps",
125+
"../examples/gallery/histograms",
126+
"../examples/gallery/embellishments",
127+
"../examples/projections/azim",
128+
"../examples/projections/conic",
129+
"../examples/projections/cyl",
130+
"../examples/projections/misc",
131+
"../examples/projections/nongeo",
132+
"../examples/projections/table",
133+
],
137134
# Pattern to search for example files
138135
"filename_pattern": r"\.py",
139136
# Remove the "Download all examples" button from the top level gallery
140137
"download_all_examples": False,
141138
# Sort gallery examples by the file names instead of number of lines [Default]
142-
"within_subsection_order": ExampleTitleSortKey,
139+
"within_subsection_order": "ExampleTitleSortKey",
143140
# Directory where function granular galleries are stored
144141
"backreferences_dir": "api/generated/backreferences",
145142
# Modules for which function level galleries are created (given as tuple of strings)

environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ dependencies:
4242
- sphinx-autodoc-typehints
4343
- sphinx-copybutton
4444
- sphinx-design
45-
- sphinx-gallery>=0.17.0
45+
- sphinx-gallery>=0.19.0
4646
- sphinx_rtd_theme<3.0
4747
# Dev dependencies (building PDF documentation)
4848
- cairosvg

0 commit comments

Comments
 (0)