#!/usr/bin/env bash # sync.sh — re-vendor the markdown-doc-kit house style into glint. # # glint embeds doc.css via go:embed so `brew install glint` ships the full # print house style with no runtime dependency on the kit. This script # re-copies doc.css from the shared kit and neutralizes the three licensed # font families (Awke / Untitled Sans / Name Mono) in the :root --font-* # tokens, leaving open/system fallbacks. glint then overrides those tokens # per-export from the user's config (font_display / font_body / font_mono). # # Run this when the kit's house style changes: # internal/export/assets/sync.sh # # Source of truth (this machine only — NOT present on users' machines): KIT="${KIT:-/Users/kortum/Developer/Home/_shared-app-kit/markdown-doc-kit}" DEST="$(cd "$(dirname "$0")" && pwd)" set -euo pipefail src="$KIT/doc.css" if [[ ! -f "$src" ]]; then echo "kit doc.css not found at $src" >&2 exit 1 fi # Copy doc.css, then strip the licensed family names from the three font # tokens so the vendored copy references only redistributable/system fonts. sed \ -e 's/--font-display: *"Awke", *"Untitled Sans", */--font-display: /' \ -e 's/--font-body: *"Untitled Sans", */--font-body: /' \ -e 's/--font-mono: *"Name Mono", */--font-mono: /' \ -e 's|the three locked faces (Awke / Untitled Sans /|the AppKit type tokens (display / body /|' \ -e 's|Name Mono), and the seven themes|mono), and the seven themes|' \ -e 's|/\* Headings — Awke display \*/|/* Headings — display face */|' \ "$src" > "$DEST/doc.css" echo "vendored doc.css ($(wc -l < "$DEST/doc.css") lines) — licensed faces neutralized"