-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
DOC: Reorder first two tutorial sections #6489
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DOC: Reorder first two tutorial sections #6489
Conversation
An alternative would be to name the files whatever is sensible, then tweak the Sphinx-gallery config to reorder sections in the |
|
https://sphinx-gallery.github.io/configuration.html#within-gallery-order You can always make your own sorter. The API is not publicly documented but you can probably figure it out from looking at the code https://sphinx-gallery.github.io/_modules/sphinx_gallery/sorting.html#NumberOfCodeLinesSortKey Basically for each |
|
@larsoner I did look at making a custom sorter a few months back, and I'm not convinced it's better here. With my "stick a number in the filename" solution, the effect on sorting is self-evident at the time any future filename or location change is being made. If I use a custom sorter, then changing a filename will necessarily cause problems if the custom sorter is not also updated (at best, it will punt the renamed file to the end of the sorting), which seems like creating extra work for future contributors. I realize that the filename looks ugly now, but once this is done for all sections I also hope to do the sphinx-gallery regex hack so that the filenames don't have to all start with |
253f8fb to
a6acdb5
Compare
Codecov Report
@@ Coverage Diff @@
## master #6489 +/- ##
==========================================
- Coverage 89.23% 8.37% -80.87%
==========================================
Files 413 399 -14
Lines 74528 73536 -992
Branches 12300 12259 -41
==========================================
- Hits 66508 6155 -60353
- Misses 5162 67324 +62162
+ Partials 2858 57 -2801 |
|
Thanks @drammock |
This puts the first two sections of the tutorials in fixed order, by introducing digits into their filenames. It also changes all cross-refs targeting those files to use
:ref:-style crossreferences instead of:doc:-style ones (exceptingdocumentation.rst, which refers to generated.rstfiles rather than cross-ref anchors).Note: I had originally been preferring
:doc:-style cross-refs because:ref:-style links to the page title will load the page already scrolled down a bit, thereby hiding the "this is the dev version" banner... but the benefit of not having to re-do the crossrefs if a filename changes seems worth that cost.