#!/bin/bash
function summarize()
{
# Did we run this in a directory with no .idx files?
[ ! -f "$1" ] && break
HTML="$(echo $1 | sed 's/\.idx$/.html/')"
TITLE="$(sed -n "s@
\(.*\)@@p" "$1")"
echo "$TITLE" >&2
echo "$TITLE"
./indexsections.py -b "$HTML" $1
}
# Start outputting top level index
(
echo "QEMU Weekly News"
echo "Latest summary
"
summarize "$(ls *.idx | sort | tail -n 1)"
echo "Previous summaries
"
# Loop through years, create year index files.
for i in 2008
do
echo ""
( echo "QEMU Weekly News for $i"
for j in $(ls $i-*.idx)
do
summarize "$j"
./indexsections.py -t "$TITLE" $j | ../clean.py > $HTML
done
echo ""
) > "$i.html"
done
echo "