Description
Since we wrote this extension to do the ordering, there's no reason we can't change it to read from
README.txt
in each directory. We could have it look for something that looks like a comment to reST so it does nothing in the sphinx-gallery-processed reST without having to do anything extra.
Originally posted by @QuLogic in #24746 (comment)
I think it's a relatively good first issue following #25028 because each readme can be parsed into its respective gallery list. Steps involved are
- figure out the reST comment notation that allows for easy specification of ordering + a consistent sentinel for placing unsorted files
- write a parser that translates the set of comments into a list that preserves the order (including sentinel)
- parse each file into its respective list in
matplotlib/doc/sphinxext/gallery_order.py
Line 48 in be7ea76
- add documentation on doing this ordering to https://github.com/matplotlib/matplotlib/blob/main/doc/devel/documenting_mpl.rst?plain=1#L933
Medium difficulty because some familiarity with sphinx would be helpful, but not strictly necessary. I think a medium to advanced version of this would be implementing a .. gallery-toc
custom directive
And yes, down the line we should maybe spin a maintain docs page off from the writing docs page.
An alternative to using the readme is using a special purpose 'gallery_order' file #24746 (comment)