File tree 1 file changed +6
-5
lines changed
1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change 6
6
from sphinx_gallery .sorting import ExplicitOrder
7
7
8
8
# Gallery sections shall be displayed in the following order.
9
- # Non-matching sections are appended.
9
+ # Non-matching sections are inserted at UNSORTED
10
10
explicit_order_folders = [
11
11
'../examples/lines_bars_and_markers' ,
12
12
'../examples/images_contours_and_fields' ,
29
29
'../plot_types/stats' ,
30
30
'../plot_types/unstructured' ,
31
31
'../plot_types/3D' ,
32
+ 'UNSORTED' ,
33
+ '../examples/userdemo' ,
34
+ '../tutorials/provisional' ,
32
35
]
33
36
34
37
@@ -37,11 +40,9 @@ class MplExplicitOrder(ExplicitOrder):
37
40
def __call__ (self , item ):
38
41
"""Return a string determining the sort order."""
39
42
if item in self .ordered_list :
40
- return "{:04d}" . format ( self .ordered_list .index (item ))
43
+ return f" { self .ordered_list .index (item ):04d } "
41
44
else :
42
- # ensure not explicitly listed items come last.
43
- return "zzz" + item
44
-
45
+ return f"{ self .ordered_list .index ('UNSORTED' ):04d} { item } "
45
46
46
47
# Subsection order:
47
48
# Subsections are ordered by filename, unless they appear in the following
You can’t perform that action at this time.
0 commit comments