Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b603ab6

Browse files
authored
Merge pull request #24940 from story645/provisional
[MNT] specify which gallery sections come last
2 parents a95775e + 0e13fe2 commit b603ab6

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

doc/sphinxext/gallery_order.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from sphinx_gallery.sorting import ExplicitOrder
77

88
# Gallery sections shall be displayed in the following order.
9-
# Non-matching sections are appended.
9+
# Non-matching sections are inserted at UNSORTED
1010
explicit_order_folders = [
1111
'../examples/lines_bars_and_markers',
1212
'../examples/images_contours_and_fields',
@@ -29,6 +29,9 @@
2929
'../plot_types/stats',
3030
'../plot_types/unstructured',
3131
'../plot_types/3D',
32+
'UNSORTED',
33+
'../examples/userdemo',
34+
'../tutorials/provisional',
3235
]
3336

3437

@@ -37,11 +40,9 @@ class MplExplicitOrder(ExplicitOrder):
3740
def __call__(self, item):
3841
"""Return a string determining the sort order."""
3942
if item in self.ordered_list:
40-
return "{:04d}".format(self.ordered_list.index(item))
43+
return f"{self.ordered_list.index(item):04d}"
4144
else:
42-
# ensure not explicitly listed items come last.
43-
return "zzz" + item
44-
45+
return f"{self.ordered_list.index('UNSORTED'):04d}{item}"
4546

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

0 commit comments

Comments
 (0)