Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,22 @@ cp slides/index.html "$out/slides/"

marp() { npx --yes "@marp-team/marp-cli@${MARP_VERSION}" "$@"; }

# The same icons as the static pages. Marp has no option for <head>, so they are
# put in after rendering.
icons='<link rel="icon" href="/favicon.ico" sizes="32x32">'
icons+='<link rel="icon" href="/icon.svg" type="image/svg+xml">'
icons+='<link rel="apple-touch-icon" href="/apple-touch-icon.png">'

for src in slides/*/index.md; do
deck=$(basename "$(dirname "$src")")
mkdir -p "$out/slides/$deck"
echo "==> $deck"
# --html: the decks use inline <br> and <span style> for layout, which Marp
# strips unless raw HTML is allowed.
marp --html "$src" -o "$out/slides/$deck/index.html"
sed -i "s#</head>#${icons}</head>#" "$out/slides/$deck/index.html"
grep -q 'href="/icon.svg"' "$out/slides/$deck/index.html" \
|| { echo "FATAL: no icons in $deck" >&2; exit 1; }
marp --html "$src" --pdf -o "$out/slides/$deck/$deck.pdf"
done

Expand Down
Loading