Skip to content

DOC Improve custom sort key docs#1401

Merged
lucyleeow merged 7 commits intosphinx-gallery:masterfrom
lucyleeow:doc_custom_sort
Nov 8, 2024
Merged

DOC Improve custom sort key docs#1401
lucyleeow merged 7 commits intosphinx-gallery:masterfrom
lucyleeow:doc_custom_sort

Conversation

@lucyleeow
Copy link
Copy Markdown
Contributor

@lucyleeow lucyleeow commented Nov 7, 2024

Follows after #1391

  • Moves the section on custom sort keys, so it does not live with the subsection docs as it applies more generally to subsection order configs as well as minigallery sort
  • Adds info on exactly what is being sorted for all 3 configs that allow custom sorting
  • Adds note that within_subsection_order allows class input, which will be instantiated by SG
  • Minor update to the 'Managing multiple gallaries' section
  • Adds docstring and comments to _get_callables

@drammock if you have time, would you take a look at this as it follows on from your PR, thank you

}

Keep in mind that both lists have to be of the same length.
Keep in mind that both lists should be of the same length.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically, it can be of differing lengths, we'll just give a warning.

Copy link
Copy Markdown
Member

@drammock drammock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

left some minor-ish suggestions for improvement / clarification. But overall I think you've covered all the bases quite nicely, thanks!

to example files and :ref:`backreference files <minigalleries_to_examples>`

The best way to do this is to define a sort function, that takes the passed path
string::
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
string::
string. For example, this function puts all filenames starting with ``plot_`` before
all other filenames::

@lucyleeow lucyleeow enabled auto-merge (squash) November 8, 2024 10:09
@lucyleeow lucyleeow merged commit 53f197a into sphinx-gallery:master Nov 8, 2024
@lucyleeow lucyleeow deleted the doc_custom_sort branch November 8, 2024 22:48
@lucyleeow
Copy link
Copy Markdown
Contributor Author

Thanks so much for your thorough review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants