FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Backport PR #24940 on branch v3.7.x ([MNT] specify which gallery sections come last) by meeseeksmachine · Pull Request #24945 · matplotlib/matplotlib · GitHub

Repository navigation

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
11 changes: 6 additions & 5 deletions doc/sphinxext/gallery_order.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from sphinx_gallery.sorting import ExplicitOrder

# Gallery sections shall be displayed in the following order.
# Non-matching sections are appended.
# Non-matching sections are inserted at UNSORTED
explicit_order_folders = [
'../examples/lines_bars_and_markers',
'../examples/images_contours_and_fields',
Expand All @@ -29,6 +29,9 @@
'../plot_types/stats',
'../plot_types/unstructured',
'../plot_types/3D',
'UNSORTED',
'../examples/userdemo',
'../tutorials/provisional',
]


Expand All @@ -37,11 +40,9 @@ class MplExplicitOrder(ExplicitOrder):
def __call__(self, item):
"""Return a string determining the sort order."""
if item in self.ordered_list:
return "{:04d}".format(self.ordered_list.index(item))
return f"{self.ordered_list.index(item):04d}"
else:
# ensure not explicitly listed items come last.
return "zzz" + item

return f"{self.ordered_list.index('UNSORTED'):04d}{item}"

# Subsection order:
# Subsections are ordered by filename, unless they appear in the following
Expand Down

Back | FazBrowse Home | New Git URL