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

separate out folders in gallery ordering#25028

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
jklymak merged 1 commit intomatplotlib:mainfromstory645:gallery_order
Jan 19, 2023
Merged
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 47 additions & 28 deletionsdoc/sphinxext/gallery_order.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,33 +6,52 @@
from sphinx_gallery.sorting import ExplicitOrder

# Gallery sections shall be displayed in the following order.
# Non-matching sections are inserted at UNSORTED
explicit_order_folders = [
'../examples/lines_bars_and_markers',
'../examples/images_contours_and_fields',
'../examples/subplots_axes_and_figures',
'../examples/statistics',
'../examples/pie_and_polar_charts',
'../examples/text_labels_and_annotations',
'../examples/pyplots',
'../examples/color',
'../examples/shapes_and_collections',
'../examples/style_sheets',
'../examples/axes_grid1',
'../examples/axisartist',
'../examples/showcase',
'../tutorials/introductory',
'../tutorials/intermediate',
'../tutorials/advanced',
'../plot_types/basic',
'../plot_types/arrays',
'../plot_types/stats',
'../plot_types/unstructured',
'../plot_types/3D',
'UNSORTED',
'../examples/userdemo',
'../tutorials/provisional',
]
# Non-matching sections are inserted at the unsorted position

UNSORTED = "unsorted"

examples_order = [
'../examples/lines_bars_and_markers',
'../examples/images_contours_and_fields',
'../examples/subplots_axes_and_figures',
'../examples/statistics',
'../examples/pie_and_polar_charts',
'../examples/text_labels_and_annotations',
'../examples/pyplots',
'../examples/color',
'../examples/shapes_and_collections',
'../examples/style_sheets',
'../examples/axes_grid1',
'../examples/axisartist',
'../examples/showcase',
UNSORTED,
'../examples/userdemo',
]

tutorials_order = [
'../tutorials/introductory',
'../tutorials/intermediate',
'../tutorials/advanced',
UNSORTED,
'../tutorials/provisional'
]

plot_types_order = [
'../plot_types/basic',
'../plot_types/arrays',
'../plot_types/stats',
'../plot_types/unstructured',
'../plot_types/3D',
UNSORTED
]

folder_lists = [examples_order, tutorials_order, plot_types_order]

explicit_order_folders = [fd for folders in folder_lists
for fd in folders[:folders.index(UNSORTED)]]
explicit_order_folders.append(UNSORTED)
explicit_order_folders.extend([fd for folders in folder_lists
for fd in folders[folders.index(UNSORTED):]])


class MplExplicitOrder(ExplicitOrder):
Expand All@@ -42,7 +61,7 @@ def __call__(self, item):
if item in self.ordered_list:
return f"{self.ordered_list.index(item):04d}"
else:
return f"{self.ordered_list.index('UNSORTED'):04d}{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

[8]ページ先頭

©2009-2025 Movatter.jp