Skip to content

Commit

Permalink
Bump to sphinx-gallery>=0.19 and use list in subsection_order and str…
Browse files Browse the repository at this point in the history
…ing in within_subsection_order (#3805)

* Use plain list in sphinx-gallery subsection_order and within_subsection_order
* Bump sphinx-gallery>=0.19
  • Loading branch information
seisman authored Feb 15, 2025
1 parent f80a229 commit 8c270a2
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 25 deletions.
45 changes: 21 additions & 24 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from pygmt import __commit__, __version__
from pygmt.clib import required_gmt_version
from pygmt.sphinx_gallery import PyGMTScraper
from sphinx_gallery.sorting import ExampleTitleSortKey, ExplicitOrder

# Dictionary for dependency name and minimum required versions
requirements = {
Expand Down Expand Up @@ -112,34 +111,32 @@
],
# Set paths where to save the generated examples
"gallery_dirs": ["intro", "tutorials", "gallery", "projections"],
"subsection_order": ExplicitOrder(
[
"../examples/intro",
"../examples/tutorials/basics",
"../examples/tutorials/advanced",
"../examples/gallery/maps",
"../examples/gallery/lines",
"../examples/gallery/symbols",
"../examples/gallery/images",
"../examples/gallery/3d_plots",
"../examples/gallery/seismology",
"../examples/gallery/basemaps",
"../examples/gallery/histograms",
"../examples/gallery/embellishments",
"../examples/projections/azim",
"../examples/projections/conic",
"../examples/projections/cyl",
"../examples/projections/misc",
"../examples/projections/nongeo",
"../examples/projections/table",
]
),
"subsection_order": [
"../examples/intro",
"../examples/tutorials/basics",
"../examples/tutorials/advanced",
"../examples/gallery/maps",
"../examples/gallery/lines",
"../examples/gallery/symbols",
"../examples/gallery/images",
"../examples/gallery/3d_plots",
"../examples/gallery/seismology",
"../examples/gallery/basemaps",
"../examples/gallery/histograms",
"../examples/gallery/embellishments",
"../examples/projections/azim",
"../examples/projections/conic",
"../examples/projections/cyl",
"../examples/projections/misc",
"../examples/projections/nongeo",
"../examples/projections/table",
],
# Pattern to search for example files
"filename_pattern": r"\.py",
# Remove the "Download all examples" button from the top level gallery
"download_all_examples": False,
# Sort gallery examples by the file names instead of number of lines [Default]
"within_subsection_order": ExampleTitleSortKey,
"within_subsection_order": "ExampleTitleSortKey",
# Directory where function granular galleries are stored
"backreferences_dir": "api/generated/backreferences",
# Modules for which function level galleries are created (given as tuple of strings)
Expand Down
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ dependencies:
- sphinx-autodoc-typehints
- sphinx-copybutton
- sphinx-design
- sphinx-gallery>=0.17.0
- sphinx-gallery>=0.19.0
- sphinx_rtd_theme<3.0
# Dev dependencies (building PDF documentation)
- cairosvg
Expand Down

0 comments on commit 8c270a2

Please sign in to comment.