Skip to content

Support HTML-cached doctrees in LaTeX tabs extension#1267

Merged
spoorcc merged 1 commit into
mainfrom
claude/modest-noether-rpc3ud
Jun 14, 2026
Merged

Support HTML-cached doctrees in LaTeX tabs extension#1267
spoorcc merged 1 commit into
mainfrom
claude/modest-noether-rpc3ud

Conversation

@spoorcc

@spoorcc spoorcc commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

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

  • Added _is_html_cached_structure() helper function to detect which document tree format is present
  • Updated LatexTabsTransform.apply() to handle two distinct sphinx-tabs tree structures:
    • Non-HTML fallback: Plain nodes.container outer nodes with [tab, panel] children (original behavior)
    • HTML-cached doctrees: SphinxTabsTablist with SphinxTabsTab children + separate SphinxTabsPanel nodes
  • Fixed self.app reference to self.env.app for proper Sphinx API usage
  • Enhanced module docstring with detailed documentation of both tree structures and ASCII diagrams

Implementation 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-tab class, 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

…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
@coderabbitai

coderabbitai Bot commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@spoorcc, we couldn't start this review because you've reached your PR review rate limit.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: b8aa5e65-433c-479e-b490-b1d1189e8b1a

📥 Commits

Reviewing files that changed from the base of the PR and between fe1ced6 and 0353092.

📒 Files selected for processing (1)
  • doc/_ext/latex_tabs.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/modest-noether-rpc3ud

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@spoorcc spoorcc merged commit e35c251 into main Jun 14, 2026
36 checks passed
@spoorcc spoorcc deleted the claude/modest-noether-rpc3ud branch June 14, 2026 20:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants