AtlatestRepositorysigil-doc
1
#!/usr/bin/env bash2
set -euo pipefail3
repo_dir="$(cd "$(dirname "$0")/.." && pwd)"4
cd "$repo_dir"5
mkdir -p "$repo_dir/build"6
cache_dir=$(mktemp -d "$repo_dir/build/xdg-cache.XXXXXX")7
sigil="${SIGIL_D1_COMPILER:-$repo_dir/../task-sigil-language-readers/build/dev/bin/sigil}"8
redirects="${SIGIL_D1_REDIRECTS:-$repo_dir/dev-redirects.sgl}"9
XDG_CACHE_HOME="$cache_dir" SIGIL_REDIRECTS="$redirects" "$sigil" -L src -L test test test/test-model.sgl --report10
# Assert the swept subjects EXIST before sweeping them: `if rg` cannot tell a11
# missing file (exit 2) from a clean one (exit 1), so a rename of the semantic12
# core would silently disarm this ban (found 2026-08-24).13
test -f src/sigil/doc/model.sgl14
test -f src/sigil/doc/traversal.sgl15
if rg -n -i '(html|sxml|css|typst|latex|slate|class=|tag:)' src/sigil/doc/model.sgl src/sigil/doc/traversal.sgl; then16
echo "backend vocabulary leaked into semantic core" >&217
exit 118
fi19
# D1 legitimately adds the reader, D4 adds HTML fragments, and D6 adds the20
# reviewed Typst source adapter. Unimplemented Slate/direct-PDF surfaces remain21
# forbidden; the semantic core above must remain backend-neutral.22
future="$(find src -type f | rg '/(slate|pdf)\.sgl$' || true)"23
test -z "$future"24
test "$(find src -type f | rg '/html\.sgl$' | wc -l)" -eq 125
test -f src/sigil/doc/render/html.sgl26
test "$(find src -type f | rg '/typst\.sgl$' | wc -l)" -eq 127
test -f src/sigil/doc/render/typst.sgl28
test "$(wc -w < test/fixtures/practical-sigil-chapter.txt)" -ge 50029
echo "D0_GATE_GREEN"