Skip to content

Add configurable D2 SVG output with bundling support - #2

Merged
mnowotnik merged 1 commit into
feature/svg-supportfrom
claude/fix-d2-test-assertions-6lPWn
Apr 19, 2026
Merged

Add configurable D2 SVG output with bundling support#2
mnowotnik merged 1 commit into
feature/svg-supportfrom
claude/fix-d2-test-assertions-6lPWn

Conversation

@mnowotnik

Copy link
Copy Markdown
Owner

Changes:

  • d2/d2.go: add SVG bundling via imgbundler, scale-aware dimensions, and adapter logger
  • renderer/fencedcodeblock.go: pass file path, bundle flag, and scale through SVG code path
  • markdown/markdown.go: wire new fenced-code renderer signature
  • util/flags.go, util/cli.go, types/types.go: introduce d2-output/d2-bundle config and propagate to MarkConfig
  • d2/d2_test.go: cover SVG path and checksum expectations
  • README.md: document new d2-output and d2-bundle options
  • go.mod/go.sum: pull in new indirect deps
  • main.go: remove stray blank line

Why:

  • Allow uploading original D2 SVGs with optional bundled assets and respect scaling to avoid manual resizing.

NotEmpty passes for "0", which contradicts the comment's intent to
ensure positive dimensions. Parse Width/Height as int64 and assert
> 0, mirroring the mermaid test pattern.
@mnowotnik
mnowotnik changed the base branch from master to feature/svg-support April 19, 2026 12:30
@mnowotnik
mnowotnik merged commit eebaa07 into feature/svg-support Apr 19, 2026
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.

2 participants