sphinx_gallery.sorting#

Classes#

class sphinx_gallery.sorting.ExampleTitleSortKey(src_dir)[source]#

Sort examples in src_dir by example title.

Parameters:

src_dir (str) – The source directory.

class sphinx_gallery.sorting.ExplicitOrder(ordered_list)[source]#

Sorting key for all gallery subsections.

This requires all folders to be listed otherwise an exception is raised.

Parameters:

ordered_list (list, tuple, or generator) – Hold the paths of each galleries’ subsections.

Raises:

ValueError – Wrong input type or Subgallery path missing.

class sphinx_gallery.sorting.FileNameSortKey(src_dir)[source]#

Sort examples in src_dir by file name.

Parameters:

src_dir (str) – The source directory.

class sphinx_gallery.sorting.FileSizeSortKey(src_dir)[source]#

Sort examples in src_dir by file size.

Parameters:

src_dir (str) – The source directory.

class sphinx_gallery.sorting.NumberOfCodeLinesSortKey(src_dir)[source]#

Sort examples in src_dir by the number of code lines.

Parameters:

src_dir (str) – The source directory.