Add markdown aggregation script and generated aggregated.md
This commit is contained in:
Executable
+19
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env bash
|
||||
# Aggregate all dossier markdown into a single aggregated.md at repo root.
|
||||
# Order: pages/*.md (index.md first, then page-NN.md numerically), then dossier.md.
|
||||
set -euo pipefail
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
out=aggregated.md
|
||||
: > "$out"
|
||||
|
||||
emit() {
|
||||
printf '\n\n<!-- ===== source: %s ===== -->\n\n' "$1" >> "$out"
|
||||
cat "$1" >> "$out"
|
||||
}
|
||||
|
||||
# sort -V: 'index.md' sorts before 'page-*', page numbers sort naturally (robust to 3-digit pages)
|
||||
while IFS= read -r f; do emit "$f"; done < <(ls pages/*.md | sort -V)
|
||||
emit dossier.md
|
||||
|
||||
echo "Wrote $out — $(grep -c 'source:' "$out") sources, $(wc -l < "$out") lines"
|
||||
+5174
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user