Skip to content

fix(cli-reference): preserve supplemental frontmatter#3488

Merged
theletterf merged 1 commit into
mainfrom
cli-reference-supplemental-frontmatter
Jun 10, 2026
Merged

fix(cli-reference): preserve supplemental frontmatter#3488
theletterf merged 1 commit into
mainfrom
cli-reference-supplemental-frontmatter

Conversation

@theletterf

Copy link
Copy Markdown
Member

Summary

  • Strips leading YAML frontmatter before applying CLI supplemental heading and description rules.
  • Preserves the frontmatter at the top of generated root, namespace, and command pages so it remains page metadata.
  • Documents frontmatter support for CLI supplemental files.

Test plan

  • dotnet test tests/Elastic.Markdown.Tests/Elastic.Markdown.Tests.csproj --filter FullyQualifiedName~CliSupplementalDocTests.
  • dotnet build.

Made with Cursor

@theletterf theletterf requested review from a team as code owners June 10, 2026 07:18
@theletterf theletterf requested a review from cotti June 10, 2026 07:18
@theletterf theletterf temporarily deployed to integration-tests June 10, 2026 07:18 — with GitHub Actions Inactive
@theletterf theletterf self-assigned this Jun 10, 2026
@theletterf theletterf added the fix label Jun 10, 2026
@elastic elastic deleted a comment from coderabbitai Bot Jun 10, 2026
@theletterf theletterf force-pushed the cli-reference-supplemental-frontmatter branch from 9610489 to 5208539 Compare June 10, 2026 08:07
@theletterf theletterf temporarily deployed to integration-tests June 10, 2026 08:07 — with GitHub Actions Inactive
@coderabbitai

coderabbitai Bot commented Jun 10, 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: Enterprise

Run ID: d2b73e42-ea9c-4816-b9fa-ad81d6a15735

📥 Commits

Reviewing files that changed from the base of the PR and between 182938f and 5184e77.

📒 Files selected for processing (4)
  • docs/cli/cli-supplemental-docs.md
  • src/Elastic.Markdown/Extensions/CliReference/CliMarkdownGenerator.cs
  • src/Elastic.Markdown/Extensions/CliReference/CliSupplementalDoc.cs
  • tests/Elastic.Markdown.Tests/CliReference/CliSupplementalDocTests.cs

📝 Walkthrough

Walkthrough

This PR adds optional YAML frontmatter support to CLI supplemental documentation. The change introduces a new FrontMatter field to CliSupplementalDoc and extracts frontmatter from raw input during parsing using a regex-backed helper. The markdown generators emit this frontmatter at the top of generated pages (RootPage, NamespacePage, CommandPage) while preserving the existing description parsing logic. Tests validate that frontmatter is preserved as metadata without being rendered as body content, and documentation clarifies the frontmatter behavior for authors.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 7.69% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: preserving YAML frontmatter in CLI supplemental documentation files.
Description check ✅ Passed The description directly relates to the changeset, explaining the three key aspects: stripping frontmatter before parsing, preserving it in generated pages, and documentation updates.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch cli-reference-supplemental-frontmatter

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.

Keep YAML frontmatter from CLI supplemental files as metadata while parsing the remaining body with the existing supplemental rules.

Co-authored-by: GPT-5.5 <gpt-5.5@openai.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@theletterf theletterf force-pushed the cli-reference-supplemental-frontmatter branch from 5208539 to 5184e77 Compare June 10, 2026 08:20
@theletterf theletterf temporarily deployed to integration-tests June 10, 2026 08:20 — with GitHub Actions Inactive
@theletterf theletterf merged commit b015bef into main Jun 10, 2026
25 checks passed
@theletterf theletterf deleted the cli-reference-supplemental-frontmatter branch June 10, 2026 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants