Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit95dab27

Browse files
story645timhoffm
andcommitted
seperate out folder orderings
Co-authored-by: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com>
1 parente12b75d commit95dab27

File tree

1 file changed

+47
-28
lines changed

1 file changed

+47
-28
lines changed

‎doc/sphinxext/gallery_order.py

Lines changed: 47 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -6,33 +6,52 @@
66
fromsphinx_gallery.sortingimportExplicitOrder
77

88
# Gallery sections shall be displayed in the following order.
9-
# Non-matching sections are inserted at UNSORTED
10-
explicit_order_folders= [
11-
'../examples/lines_bars_and_markers',
12-
'../examples/images_contours_and_fields',
13-
'../examples/subplots_axes_and_figures',
14-
'../examples/statistics',
15-
'../examples/pie_and_polar_charts',
16-
'../examples/text_labels_and_annotations',
17-
'../examples/pyplots',
18-
'../examples/color',
19-
'../examples/shapes_and_collections',
20-
'../examples/style_sheets',
21-
'../examples/axes_grid1',
22-
'../examples/axisartist',
23-
'../examples/showcase',
24-
'../tutorials/introductory',
25-
'../tutorials/intermediate',
26-
'../tutorials/advanced',
27-
'../plot_types/basic',
28-
'../plot_types/arrays',
29-
'../plot_types/stats',
30-
'../plot_types/unstructured',
31-
'../plot_types/3D',
32-
'UNSORTED',
33-
'../examples/userdemo',
34-
'../tutorials/provisional',
35-
]
9+
# Non-matching sections are inserted at the unsorted position
10+
11+
UNSORTED="unsorted"
12+
13+
examples_order= [
14+
'../examples/lines_bars_and_markers',
15+
'../examples/images_contours_and_fields',
16+
'../examples/subplots_axes_and_figures',
17+
'../examples/statistics',
18+
'../examples/pie_and_polar_charts',
19+
'../examples/text_labels_and_annotations',
20+
'../examples/pyplots',
21+
'../examples/color',
22+
'../examples/shapes_and_collections',
23+
'../examples/style_sheets',
24+
'../examples/axes_grid1',
25+
'../examples/axisartist',
26+
'../examples/showcase',
27+
UNSORTED,
28+
'../examples/userdemo',
29+
]
30+
31+
tutorials_order= [
32+
'../tutorials/introductory',
33+
'../tutorials/intermediate',
34+
'../tutorials/advanced',
35+
UNSORTED,
36+
'../tutorials/provisional'
37+
]
38+
39+
plot_types_order= [
40+
'../plot_types/basic',
41+
'../plot_types/arrays',
42+
'../plot_types/stats',
43+
'../plot_types/unstructured',
44+
'../plot_types/3D',
45+
UNSORTED
46+
]
47+
48+
folder_lists= [examples_order,tutorials_order,plot_types_order]
49+
50+
explicit_order_folders= [fdforfoldersinfolder_lists
51+
forfdinfolders[:folders.index(UNSORTED)]]
52+
explicit_order_folders.append(UNSORTED)
53+
explicit_order_folders.extend([fdforfoldersinfolder_lists
54+
forfdinfolders[folders.index(UNSORTED):]])
3655

3756

3857
classMplExplicitOrder(ExplicitOrder):
@@ -42,7 +61,7 @@ def __call__(self, item):
4261
ifiteminself.ordered_list:
4362
returnf"{self.ordered_list.index(item):04d}"
4463
else:
45-
returnf"{self.ordered_list.index('UNSORTED'):04d}{item}"
64+
returnf"{self.ordered_list.index(UNSORTED):04d}{item}"
4665

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

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp