Skip to content

feat(very_good_docs_site_jaspr): add Jaspr-powered docs site template - #617

Draft
marcossevilla wants to merge 1 commit into
mainfrom
session/defiant-pelican-w78p
Draft

feat(very_good_docs_site_jaspr): add Jaspr-powered docs site template#617
marcossevilla wants to merge 1 commit into
mainfrom
session/defiant-pelican-w78p

Conversation

@marcossevilla

@marcossevilla marcossevilla commented Sep 8, 2026

Copy link
Copy Markdown
Member

Description

Closes #547

Adds very_good_docs_site_jaspr, an all-Dart documentation site template powered by Jaspr, as the counterpart to the Docusaurus-based very_good_docs_site. Generated sites carry no Node.js toolchain: no package.json, no npm, no JavaScript build config.

What the brick generates

  • A landing page (hero, CTA, three feature pillars) and a docs layout built on jaspr_content's DocsLayout
  • A sidebar derived from the filesystem, mirroring Docusaurus's { type: 'autogenerated' } behavior, ordered by sidebar_position frontmatter
  • Light/dark theming through ColorTokens in one file (lib/src/colors.dart)
  • Speculation Rules for hover-prefetch and pointer-down prerender, closing most of the gap with an SPA router
  • Per-page "Edit this page" links, a GitHub navbar link, and a three-column site footer
  • The usual scaffolding: issue templates, PR template, dependabot, CI workflow, MIT license

Registry wiring

Registered in mason.yaml, .release-please-config.json / .release-please-manifest.json (at 0.1.0), .github/dependabot.yaml, and bot_dependency_tightener.yaml, plus the three per-brick workflows (generate/verify, hooks, publish) and the active-brick list in AGENTS.md.

Notes for reviewers

Two workarounds are load-bearing and documented in place, rather than left for a future maintainer to rediscover:

  • grammars/bash.json is a vendored TextMate grammar; grammars/yaml.json is hand-written. syntax_highlight_lite bundles only Dart, and a fence tagged with an unregistered language fails the build rather than degrading to plain text. The upstream YAML grammar relies on Oniguruma (?x) free-spacing regexes that Dart's RegExp cannot parse, so it throws FormatException: Invalid group. The rationale and the condition for removing the hand-written file live in its information_for_contributors block.
  • build_web_compilers is imported by nothing but is what jaspr_cli compiles the client entrypoint through; a comment in pubspec.yaml records that.

The lib/main.*.options.dart files ship as the same stubs upstream Jaspr's own docs template ships. jaspr_builder declares them build_to: source and regenerates the real contents on every build, so committing a post-build snapshot would hard-code jaspr_content's private component surface behind a caret constraint.

Known follow-up, deliberately not in this PR

org_name currently serves two incompatible roles: LICENSE renders it as a copyright holder, while lib/main.server.dart splices it into https://github.com/{org_name}/{project_name}. No single value satisfies both. Splitting it into org_name plus a separate repo_owner changes the brick's variable surface, so it is worth its own discussion. This is inherited from very_good_docs_site, not introduced here.

Also left for a follow-up: component styles are mounted per-component via Document.head, so they are re-serialized per page and ship as duplicate <style> blocks in every page's head. Moving to @css plus styles: standalone would emit one build-time main.css, but it touches every component and warrants a separate change.

Verification

mason make from config.json, then against the generated output: dart format --set-exit-if-changed clean, dart analyze --fatal-infos --fatal-warnings clean, and jaspr build completing all 4 routes. Hook package formats, analyzes, and tests clean. cspell clean across the brick's .md and .dart files.

Type of Change

  • ✨ New feature (non-breaking change which adds functionality)
  • 🛠️ Bug fix (non-breaking change which fixes an issue)
  • ❌ Breaking change (fix or feature that would cause existing functionality to change)
  • 🧹 Code refactor
  • ✅ Build configuration change
  • 📝 Documentation
  • 🗑️ Chore
  • 🧪 Test

🤖 Generated with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Needs Triage

Development

Successfully merging this pull request may close these issues.

refactor: migrate very_good_docs_site to jaspr

1 participant