Walk the toctree to order nodes#24
Open
Yoshanuikabundi wants to merge 1 commit intoexecutablebooks:masterfrom
Open
Walk the toctree to order nodes#24Yoshanuikabundi wants to merge 1 commit intoexecutablebooks:masterfrom
Yoshanuikabundi wants to merge 1 commit intoexecutablebooks:masterfrom
Conversation
|
Thanks for submitting your first pull request! You are awesome! 🤗 |
Member
|
Hey, @Yoshanuikabundi . Thank you so much for the improvement. Sorry, we took so long to see this PR. I will verify it next week and give feedback/merge. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi!
Thank you for this extension, it was just what I needed. Unfortunately, it did not correctly order the chapters for the project I was working on, which has an unusual structure:
application,libraryandtheorythen have numbered toctrees of their own. I wanted chapter numbers to start at 1. Introduction, work through the toctree in order, and end at 22. Bibliography. Instead I got alphabetical ordering by reference name. I think this is partly becauseenv.tocsis alphabetically ordered, at least in Sphinx 4, but also because I have numbered toctrees inindexsurrounding other numbered toctrees in other files. Even a correctly orderedenv.tocswouldn't be able to correctly render this tree, as it is sorted on the file level.I solved this by walking the entire toctree, starting at
index, and recording each numbered node in the order encountered. Then I just iterate over that list to number the tree. This should be pretty robust!I'm contributing this back to you with thanks and in the hopes that it's useful to you or someone else. If you'd like to merge it, I'd be happy to write a test to make sure the above bug doesn't recur!