Support HTML-cached doctrees in LaTeX tabs extension#1267
Conversation
…uild The Sphinx Makefile uses -M mode, which shares a single _build/.doctrees/ directory across all builders. When `make html` runs first, doctrees are written with sphinx-tabs HTML node types (SphinxTabsTablist, SphinxTabsTab, SphinxTabsPanel). When `make latexpdf` runs next, the LatexTabsTransform encountered this HTML structure instead of the non-HTML fallback it expected, causing tab labels to render as plain paragraph text rather than \subsubsection* headings. Fix by detecting which structure is present (HTML-cached vs non-HTML fallback) and handling each path correctly. Also replace the deprecated self.app access with self.env.app to silence the Sphinx 8 deprecation warning. https://claude.ai/code/session_01UGnrctHsi8vRVecbAm4ncn
|
Warning Review limit reached
More reviews will be available in 43 minutes and 45 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Update the LaTeX tabs extension to handle both fresh RST parsing and HTML-cached doctree structures. When the Makefile shares a
_build/.doctrees/directory across builders, the LaTeX builder may read cached doctrees containing sphinx-tabs HTML node types instead of the plain container structure.Key Changes
_is_html_cached_structure()helper function to detect which document tree format is presentLatexTabsTransform.apply()to handle two distinct sphinx-tabs tree structures:nodes.containerouter nodes with[tab, panel]children (original behavior)SphinxTabsTablistwithSphinxTabsTabchildren + separateSphinxTabsPanelnodesself.appreference toself.env.appfor proper Sphinx API usageImplementation Details
The transform now inspects the first child of the sphinx-tabs container to determine which structure is present. If it finds a container with children having the
sphinx-tabs-tabclass, it treats the tree as HTML-cached and processes the tablist + panels accordingly. Otherwise, it falls back to the original container-based processing logic.https://claude.ai/code/session_01UGnrctHsi8vRVecbAm4ncn