Initial commit

This commit is contained in:
2026-10-20 11:51:52 -05:00
commit b3ae1e5afe
17 changed files with 5651 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
#!/bin/sh
# Regenerates Sources/mdview/Assets.swift from the files in assets/, embedding
# them as Swift raw string literals so the binary is fully self-contained.
set -eu
cd "$(dirname "$0")/.."
out=Sources/mdview/Assets.swift
emit() {
name=$1
file=$2
if grep -q '"""##' "$file"; then
echo "error: $file contains the raw string delimiter" >&2
exit 1
fi
printf ' static let %s = ##"""\n' "$name"
cat "$file"
printf '\n"""##\n\n'
}
{
echo '// Generated by scripts/gen-assets.sh -- do not edit by hand.'
echo
echo 'enum Assets {'
emit markdownCSS assets/github-markdown.css
emit highlightLightCSS assets/hljs-github.css
emit highlightDarkCSS assets/hljs-github-dark.css
emit highlightJS assets/highlight.min.js
echo '}'
} > "$out"
echo "wrote $out"