show-extensions: fix hook-doc rendering (heading marker + btrfs docs) - #10532
show-extensions: fix hook-doc rendering (heading marker + btrfs docs)#10532igorpecovnik wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 8 included reviews per hour; 6 remain after this review. 📝 WalkthroughWalkthroughThe CLI documentation output now normalizes heading markers and conditionally separates body lines. Btrfs extension hook comments now include structured descriptions and fenced examples. ChangesExtension Documentation
Estimated code review effort: 1 (Trivial) | ~5 minutes Merge Risk: ⚪ Minimal · up to This change fixes hook documentation formatting without introducing an actionable merge-blocking risk; it is merge-ready after normal checks and review. Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 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 |
Two rendering bugs on the generated Extension Hooks docs page: 1. The docs formatter emitted the one-line summary as `> <first-comment-line>`. When a hook's inline doc opened with a `#`-prefixed line (e.g. btrfs_root_add_subvolumes), that became `> #text` — a level-1 heading inside a blockquote, which rendered huge and broke the page's table of contents for every hook after it. Strip a leading `#` from the summary so it can never become a heading; also guard the body so summary-only hooks emit no trailing blank. 2. The two btrfs_root_add_subvolumes[_fstab] hook docs were raw shell (comment lines + example commands), not markdown, so they rendered as run-together text. Rewrite them as a prose summary + description + a fenced example. Generated docs are prose (with inline code) as intended; hook doc comments are markdown and should be written as such. Signed-off-by: Igor Pecovnik <igor@armbian.com>
cc76b90 to
adf2168
Compare
Problem
The generated Extension Hooks page had two rendering bugs:
> <first inline-doc line>. When that line started with#(e.g.btrfs_root_add_subvolumes, whose comment opens# custom post btrfs...), it became> # text— a level-1 heading inside a blockquote. It rendered oversized and broke the page's table of contents for every hook after it.btrfs_root_add_subvolumes[_fstab]hook docs were shell comments + example commands, not markdown, so they rendered as run-together text.Fix
lib/functions/cli/cli-show-extensions.sh: strip a leading#from the summary so it can never become a heading; guard the body so summary-only hooks don't emit a trailing blank. Bodies stay prose (with inline code), as intended.lib/functions/image/partitioning.sh: rewrite the two btrfs hook docs as a prose summary + description + a fenced example.Hook doc comments are markdown and should be written as such; this makes the two offenders conform and stops one of them from breaking the page.
bash -nclean. Verified: full 65-hook TOC, clean prose rendering.Summary by CodeRabbit