fix(docs): generate CLI reference for Astro Starlight - #2096
Merged
Conversation
The Documentation workflow regenerates the CLI reference into the marketing-site, which has migrated from Nextra to Astro (Starlight). The generator still emitted Nextra-style output, so running the action would revert the migration and break the Astro build. - Emit a required `title` frontmatter on every page (Starlight's docsSchema requires it); keep `asIndexPage: true` on index pages. - Drop the redundant `# <name>` body heading, since Starlight renders the frontmatter title as the page's single H1. - Demote `# ` headings in command Long descriptions to `## ` so they don't compete with the title H1, respecting fenced code blocks so shell comments in usage examples are left intact. - Remove the dead `_meta.tsx` entry from the preserve-list (a Nextra sidebar file that no longer exists in the Astro structure). Regenerating in-place over the committed docs now yields a byte-for-byte match (aside from the env-specific --output-dir default in pull.md). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
AshGodfrey
self-requested a review
July 6, 2026 12:11
AshGodfrey
approved these changes
Jul 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The
Documentationworkflow (.github/workflows/documentation.yml) regenerates the CLI reference docs into the marketing-site and opens a PR. The marketing-site has migrated from Nextra to Astro (Starlight), but the doc generator still emitted Nextra-style output. Running the action against the new site would have reverted the migration and broken the Astro build:titlefrontmatter — Starlight'sdocsSchema()requires atitleon every page. The generator emitted no frontmatter for leaf pages and onlyasIndexPage: truefor index pages, so regenerating would strip the hand-added titles → build failure.# <name>body heading, but Starlight renders the frontmattertitleas the page H1.Longtext — several commands'Longdescriptions start with a# Heading, producing a second body H1. The migration had demoted these to##.Changes
internal/docs/docs.go:title: "<name>"frontmatter on every page; keepasIndexPage: trueon index pages.# <name>body heading.demoteHeadings()to demote#→##inLong/Details content, respecting fenced code blocks so#shell comments in usage examples are left intact.cmd/docs/main.go:_meta.tsxentry from the preserve-list (a Nextra sidebar file that no longer exists in the Astro structure).The workflow YAML already targets the correct Astro path (
src/content/docs/speakeasy-reference/cli) and setsCLI_RUNTIME: docs, so no change was needed there.Verification
Running the generator in-place over the actual committed marketing-site docs now yields a byte-for-byte match — the only diff is
pull.md's--output-dirdefault, which is the current working directory and resolves to the identical path on the CI runner. Static hand-authored files (getting-started.mdx,mise-toolkit.mdx,docker.mdx) are preserved.go build,go vet, andgofmtare clean.🤖 Generated with Claude Code