feat: make unsupported node types markdown-friendly before writing - #134
feat: make unsupported node types markdown-friendly before writing#134kartben wants to merge 1 commit into
Conversation
sphinx-markdown-builder drops the node types it does not support (they only produce an "unknown node type" warning), silently losing content from the markdown renditions and the llms.txt outputs. Convert the affected node types into supported equivalents in a post-transform that runs before documents get written: - tip and caution admonitions are mapped to hint and attention, which render as markdown boxes with a similar meaning - generic admonitions and sidebars become a bold title followed by their content - figure captions and legends are turned into regular (emphasized) content - abbreviations keep their text, so words are no longer removed from the middle of sentences Assisted-by: Claude:fable-5 Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
jacobtomlinson
left a comment
There was a problem hiding this comment.
I think this is a great improvement, but I feel this should probably be contributed to the markdown builder, not here.
I suggest you open a PR there to add support for these things. Then if they are not accepted or don't get reviewed we can think about adding this shim here until they do support it upstream.
One thing to consider would be if we added this, and then support was added upstream, how would we handle this?
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #134 +/- ##
===========================================
+ Coverage 81.89% 91.96% +10.07%
===========================================
Files 4 10 +6
Lines 624 2252 +1628
Branches 87 217 +130
===========================================
+ Hits 511 2071 +1560
- Misses 84 134 +50
- Partials 29 47 +18
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This makes perfect sense, thanks for the prompt feedback! |
|
sphinx-markdown-builder drops the node types it does not support (they only produce an "unknown node type" warning), silently losing content from the markdown renditions and the llms.txt outputs. Convert the affected node types into supported equivalents in a post-transform that runs before documents get written: