Skip to content

show-extensions: fix hook-doc rendering (heading marker + btrfs docs) - #10532

Open
igorpecovnik wants to merge 1 commit into
mainfrom
fix/show-extensions-docs-fenced-body
Open

show-extensions: fix hook-doc rendering (heading marker + btrfs docs)#10532
igorpecovnik wants to merge 1 commit into
mainfrom
fix/show-extensions-docs-fenced-body

Conversation

@igorpecovnik

@igorpecovnik igorpecovnik commented Aug 25, 2026

Copy link
Copy Markdown
Member

Problem

The generated Extension Hooks page had two rendering bugs:

  1. Broken TOC + giant blockquote. The docs formatter printed the hook summary as > <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.
  2. Raw-shell hook docs. The two 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 -n clean. Verified: full 65-hook TOC, clean prose rendering.

Summary by CodeRabbit

  • Documentation
    • Improved formatting of extension documentation output.
    • Updated Btrfs partitioning hook guidance with clearer descriptions and fenced examples.
    • Improved handling of optional documentation content and spacing.

@coderabbitai

coderabbitai Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 79bc6371-0c3f-4126-9173-772a9a3d7dbb

📥 Commits

Reviewing files that changed from the base of the PR and between cc76b90 and adf2168.

📒 Files selected for processing (2)
  • lib/functions/cli/cli-show-extensions.sh
  • lib/functions/image/partitioning.sh

Included review availability: Your plan provides up to 8 included reviews per hour; 6 remain after this review.


📝 Walkthrough

Walkthrough

The CLI documentation output now normalizes heading markers and conditionally separates body lines. Btrfs extension hook comments now include structured descriptions and fenced examples.

Changes

Extension Documentation

Layer / File(s) Summary
Format CLI documentation output
lib/functions/cli/cli-show-extensions.sh
SHOW_EXTENSIONS=docs removes leading # markers before blockquote rendering and adds a blank line only when additional body lines exist.
Document Btrfs extension hooks
lib/functions/image/partitioning.sh
The subvolume and fstab hooks now describe their timing, responsibilities, and examples in structured documentation.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Merge Risk: ⚪ Minimal · up to adf21

This change fixes hook documentation formatting without introducing an actionable merge-blocking risk; it is merge-ready after normal checks and review.

Suggested reviewers: iav

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main changes: fixing hook documentation rendering and updating Btrfs documentation.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/show-extensions-docs-fenced-body

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.

@github-actions github-actions Bot added 08 Milestone: Third quarter release size/small PR with less then 50 lines Needs review Seeking for review Framework Framework components labels Aug 25, 2026
@igorpecovnik igorpecovnik added Work in progress Unfinished / work in progress and removed Needs review Seeking for review labels Aug 25, 2026
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>
@igorpecovnik igorpecovnik changed the title show-extensions: fence hook-doc bodies in the docs output show-extensions: fix hook-doc rendering (heading marker + btrfs docs) Aug 25, 2026
@igorpecovnik
igorpecovnik force-pushed the fix/show-extensions-docs-fenced-body branch from cc76b90 to adf2168 Compare August 25, 2026 17:34
@github-actions github-actions Bot added the Needs review Seeking for review label Aug 25, 2026
@igorpecovnik igorpecovnik added Documentation Documentation changes or additions Framework Framework components Needs review Seeking for review Ready to merge Reviewed, tested and ready for merge and removed Needs review Seeking for review Framework Framework components Work in progress Unfinished / work in progress labels Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

08 Milestone: Third quarter release Documentation Documentation changes or additions Framework Framework components Ready to merge Reviewed, tested and ready for merge size/small PR with less then 50 lines

Development

Successfully merging this pull request may close these issues.

1 participant