Skip to content

feat: add Pennington.Beck server-side diagram rendering#67

Merged
phil-scott-78 merged 1 commit into
mainfrom
feat/beck-diagrams
Jul 10, 2026
Merged

feat: add Pennington.Beck server-side diagram rendering#67
phil-scott-78 merged 1 commit into
mainfrom
feat/beck-diagrams

Conversation

@phil-scott-78

Copy link
Copy Markdown
Contributor

Summary

  • New src/Pennington.Beck/ package: AddPenningtonBeck registers a BeckCodeBlockPreprocessor (ICodeBlockPreprocessor, priority 500) that renders ```beck fences to self-animating inline SVG at build time via the pure-C# Beck engine — Beck 0.4 dropped the client-JS engine, so there is no script hydration anymore.
  • Each embed gets a fullscreen-zoom lightbox via a head-contributed script + CSS (BeckZoomHeadContributor; opt out with BeckOptions.Zoom = false). Supports beck:symbol file embeds (resolved against BeckOptions.ContentRoot), static/scrub animation flags, and style= overrides.
  • Fails loud: a malformed fence renders a .beck-embed--error box and lands in DiagnosticContext.

Docs site

  • Swap the Beck RCL <script> tag for AddPenningtonBeck (ContentRoot matches tree-sitter so beck:symbol embeds resolve repo-root-relative).
  • The emitted SVG keys dark mode off [data-theme], which the DocSite toggle doesn't set — a small head script mirrors the .dark class onto the attribute.
  • Frame embeds as preview cards via site CSS; new how-to page rich-content/beck-diagrams.md; existing explanation-page diagrams updated to the 0.4 schema.

Dependencies

  • Beck 0.3.0 → 0.4.3, add YamlDotNet 18.1.0.

Test plan

  • dotnet build Pennington.slnx — 0 warnings, 0 errors
  • 19 new Beck unit tests pass (BeckCodeBlockPreprocessorTests, BeckZoomHeadContributorTests)

Add src/Pennington.Beck, a build-time renderer for ```beck fenced code
blocks. AddPenningtonBeck registers a BeckCodeBlockPreprocessor
(ICodeBlockPreprocessor, priority 500) that renders fences to
self-animating inline SVG via the pure-C# Beck engine — Beck 0.4
dropped the client-JS engine, so no script hydration remains.

- Fullscreen-zoom lightbox per embed via BeckZoomHeadContributor
  (opt out with BeckOptions.Zoom = false)
- beck:symbol file embeds resolved against BeckOptions.ContentRoot,
  static/scrub animation flags, style= overrides
- Malformed fences fail loud: .beck-embed--error box + DiagnosticContext

Docs site: replace the Beck RCL script tag with AddPenningtonBeck,
mirror the .dark class onto [data-theme] so the SVGs follow the theme
toggle, frame embeds as preview cards, and add a beck-diagrams how-to.
Existing explanation-page diagrams updated for the 0.4 schema.

Bump Beck 0.3.0 -> 0.4.3; add YamlDotNet 18.1.0.
@github-actions

Copy link
Copy Markdown

🛰️ Docs preview: https://pr-67.pennington-dev.pages.dev

Rebuilt on every push to this PR; torn down when it closes.

@phil-scott-78
phil-scott-78 merged commit 362b71e into main Jul 10, 2026
4 checks passed
@phil-scott-78
phil-scott-78 deleted the feat/beck-diagrams branch July 10, 2026 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant