Skip to content

Add an SVG export to the Card Builder - #344

Merged
nstarman merged 1 commit into
mainfrom
add/card-svg-export
Oct 6, 2026
Merged

nstarman merged 1 commit into
mainfrom
add/card-svg-export

Conversation

@nstarman

@nstarman nstarman commented Oct 6, 2026

Copy link
Copy Markdown
Owner

Changing code or schema

What and why: an SVG format beside PNG and PDF in the Card Builder, so a card can be exported as vector text with its link buttons intact.

  • src/lib/cardsvg.js (pure): writes the measured card — the same model cardpdf.js hands Typst — as SVG. Text is vector with textLength pinned to the measured line, figures are embedded as data URIs, each linked part sits in an <a>.

  • cardpdf.js: text ops now carry the width of the whole line (before, only the first character's), which the SVG needs and the PDF ignores.

  • Builder: svg is a format (settings, file name …-light.svg, download button, note). Both themes when following the reader, as for PNG.

  • Caveat, stated in the builder's note: links are live when the SVG is opened or inlined, but a browser never runs links in an <img> — GitHub READMEs included.

  • Checked in a browser: the SVG of the unxt lead card against the CSS card (same layout; Plex falls back to the reader's fonts where not installed).

  • npm run test:schema passes; 575 unit tests and the build pass; tests/cardsvg.test.js renders the output with sharp to prove it parses

🤖 Generated with Claude Code

The card as the browser laid it out — the measurement the PDF already
takes — written as SVG: vector text, figures embedded, and each link kept
as an <a>, live where the file is opened or embedded inline. cardpdf.js's
text ops now carry the width of the whole line, not its first character.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added this to the ♾️&➡ milestone Oct 6, 2026
@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Preview: https://ee539fb3.nstarkman-space.pages.dev

Built from d06cdb33a09622f753f8fb1279e253cbe349e0ae, including the four CV PDFs.
Updated on every push to this pull request.

@nstarman
nstarman merged commit dc06013 into main Oct 6, 2026
7 of 8 checks passed
@nstarman
nstarman deleted the add/card-svg-export branch October 6, 2026 18:01
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