fix(docs): frontmatter disclosure, sidenav directory tree, themed syntax highlighting - #430
Merged
Merged
Conversation
goldmark was reading the opening --- as a thematic break and folding the YAML into a mangled heading. The frontmatter extension now consumes it at parse; the parsed pairs render as a collapsed disclosure (kv grid) above the body, built post-sanitizer with every fragment HTML-escaped. Session-Name: deft-sonata Session-Id: 7fc5913c-2346-479f-a249-9d871812e47d Model: claude-fable-5 Harness: claude-code 2.1.252 Machine: cf6e768835c7 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…denav 887 docs rendered as one flat scroll. Per-root groups now emit nested tree--static markup (details per directory, leaf counts, path to the current doc pre-expanded); the filter box hides empty branches and auto-expands matches, restoring rest state on clear. Recent stays flat. Session-Name: deft-sonata Session-Id: 7fc5913c-2346-479f-a249-9d871812e47d Model: claude-fable-5 Harness: claude-code 2.1.252 Machine: cf6e768835c7 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The served chroma stylesheet was generated monokai — a hardcoded palette slab that ignored the page theme entirely. Chroma already emits class-based output, so the stylesheet swaps to a hand-authored mapping onto the design-system syntax roles and follows light/dark for free. Session-Name: deft-sonata Session-Id: 7fc5913c-2346-479f-a249-9d871812e47d Model: claude-fable-5 Harness: claude-code 2.1.252 Machine: cf6e768835c7 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Review findings folded: a greedy frontmatter opener swallowed any doc merely opening with a thematic break (gated via hasWellFormedFrontmatter plus a plain parser); non-mapping frontmatter no longer vanishes; the static tree gets twisty rotation and count styling; the badge counts rendered pairs; scoped lint fixes in the new tests. Session-Name: deft-sonata Session-Id: 7fc5913c-2346-479f-a249-9d871812e47d Model: claude-fable-5 Harness: claude-code 2.1.252 Machine: cf6e768835c7 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Session-Name: deft-sonata Session-Id: 7fc5913c-2346-479f-a249-9d871812e47d Model: claude-fable-5 Harness: claude-code 2.1.252 Machine: cf6e768835c7 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Three rendering defects in
forgectl docs serve, all surfaced by looking at the reader on real docs:---as a thematic break and folded the YAML into a broken heading. The frontmatter extension now consumes it at parse; the parsed pairs render as a collapsed "Front matter · N keys" disclosure (kv grid) above the body. The block is built after sanitization fromhtml.EscapeString'd fragments only, so the bluemonday allowlist stays untouched. A well-formedness gate protects docs that merely open with a thematic break — the extension's greedy opener otherwise swallowed the whole body (found by review, pinned by test).tree--static(native details/summary, no JS needed): per-directory counts, path to the current doc pre-expanded, filter box hides empty branches and auto-expands matches.Reviewed pre-PR: two independent code reviews (findings folded, incl. the body-swallowing gate), an independent Opus security review (verdict clean — the post-sanitizer prepend was empirically probed with hostile YAML: anchors, block scalars, angle-bracketed keys; zero OSV advisories on the two new deps), scoped lint clean,
go build ./... && go test ./...green.BEGIN_COMMIT_OVERRIDE
fix(docs): the reader now renders YAML/TOML frontmatter as a collapsed metadata disclosure instead of leaking it into the body as a broken heading; each indexed root renders as a collapsible directory tree (counts, current-path pre-expanded, filter-aware) instead of a flat list; and syntax highlighting follows the light/dark theme instead of a fixed monokai palette
END_COMMIT_OVERRIDE
Session-Name: deft-sonata
Session-Id: 7fc5913c-2346-479f-a249-9d871812e47d
Model: claude-fable-5
Harness: claude-code 2.1.252
Machine: cf6e768835c7