feat: add Pennington.Beck server-side diagram rendering#67
Merged
Conversation
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.
|
🛰️ Docs preview: https://pr-67.pennington-dev.pages.dev Rebuilt on every push to this PR; torn down when it closes. |
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.
Summary
src/Pennington.Beck/package:AddPenningtonBeckregisters aBeckCodeBlockPreprocessor(ICodeBlockPreprocessor, priority 500) that renders```beckfences 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.BeckZoomHeadContributor; opt out withBeckOptions.Zoom = false). Supportsbeck:symbolfile embeds (resolved againstBeckOptions.ContentRoot),static/scrubanimation flags, andstyle=overrides..beck-embed--errorbox and lands inDiagnosticContext.Docs site
<script>tag forAddPenningtonBeck(ContentRoot matches tree-sitter sobeck:symbolembeds resolve repo-root-relative).[data-theme], which the DocSite toggle doesn't set — a small head script mirrors the.darkclass onto the attribute.rich-content/beck-diagrams.md; existing explanation-page diagrams updated to the 0.4 schema.Dependencies
Test plan
dotnet build Pennington.slnx— 0 warnings, 0 errorsBeckCodeBlockPreprocessorTests,BeckZoomHeadContributorTests)