feat: add mermaid diagram rendering via sphinxcontrib.mermaid#83
feat: add mermaid diagram rendering via sphinxcontrib.mermaid#83illilillillili wants to merge 2 commits into
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthrough
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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 |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/atsphinx/typst/writer.py`:
- Around line 200-205: The Mermaid rendering fallback in writer.py uses a bare
except in the render_mm call path, which can swallow BaseException and violates
Ruff E722. Update the exception handling in the Mermaid render block inside the
writer logic to catch Exception or a narrower render-specific error instead,
while keeping the existing logger.exception and relfn/outfn fallback behavior
unchanged.
- Around line 239-244: The Mermaid rendering fallback in
TypstTranslator.visit_mermaid is swallowing Docutils SkipNode from the delegated
image rendering, which turns normal skip control flow into a false failure log.
Update the exception handling around the super(TypstTranslator,
self).visit_image and super(TypstTranslator, self).depart_image calls to
explicitly catch and re-raise nodes.SkipNode before the generic Exception
handler, while keeping the existing ImportError and warning behavior for real
failures.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 50e5421b-0494-475c-8faa-c2d2661263e7
📒 Files selected for processing (1)
src/atsphinx/typst/writer.py
7c6b306 to
d0fc68c
Compare
Adds support for
or in rst
and renders it with mmdc (configurable) to svg, which is then imported as an image
conf.pycould contain: