Add PyTorch 2.8 and 2.9 documentation support #2629
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.
The PR updates the PyTorch scraper for documentation versions 2.8 and 2.9, addressing changes in the theme and HTML structure.
The PyTorch 2.8 and 2.9 uses a new sphinx theme, which is somewhat unfriendly to scrapers at the moment. The commit mainly addresses truncations in the breadcrumb navigation section (e.g. https://docs.pytorch.org/docs/2.9/name_inference.html, https://docs.pytorch.org/docs/2.9/config_mod.html) by extracting the text inside the heading instead.
The extracted doc structure is slightly different from those of older PyTorch docs because sometimes truncations happen in the middle of the navigation paths (e.g. https://docs.pytorch.org/docs/2.9/torch.compiler_aot_inductor_debugging_guide.html).
Key changes:
If you're updating existing documentation to its latest version, please ensure that you have:
SOURCEfile inpublic/icons/your_scraper_name/are up-to-date if the documentation has a custom iconself.linkscontains up-to-date urls ifself.linksis defined