Skip to content
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

Refactor sphinx.environment.adapters.TocTree #11565

Merged
merged 24 commits into from
Aug 9, 2023

Conversation

AA-Turner
Copy link
Member

This speeds up TocTree resolution by 3-6x, in local benchmarks.

A

@AA-Turner AA-Turner merged commit 6f5a99a into sphinx-doc:master Aug 9, 2023
25 of 26 checks passed
@AA-Turner AA-Turner deleted the toctree-resolve branch August 9, 2023 14:43
@AA-Turner AA-Turner added this to the 7.2.0 milestone Aug 11, 2023
@mgeier
Copy link
Contributor

mgeier commented Aug 12, 2023

This change broke the generation of galleries in nbsphinx (which are based on toctree): spatialaudio/nbsphinx#755

I know that I'm doing some dubious monkey patching (https://github.com/spatialaudio/nbsphinx/blob/master/src/nbsphinx/__init__.py#L1485-L1506), but I'm not sure if the document representation is supposed to have changed in this PR?

The API change didn't make any problems, but the document structure seems to have changed. I still have to look into the details of what has changed here, but if it is not too much of a problem to restore the previous stucture, this would be great!

@AA-Turner
Copy link
Member Author

The actual resolution algorithm shouldn't've changed. Please could you open a new issue with how the new API (function based) differs from the old (class based)?

A

@mgeier
Copy link
Contributor

mgeier commented Aug 13, 2023

OK, I looked into it and it turns out that I was wrong. The document structure is not different, but my monkey-patching is broken.

In spatialaudio/nbsphinx#756 I'm trying to monkey-patch _resolve_toctree instead of TocTree.resolve (depending on Sphinx version), but it still doesn't work.

It seems like setting the property toctree['nbsphinx_gallery'] doesn't work anymore, do you have an idea why this might be the case?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants