miller/docs/genrst
2020-09-27 10:43:28 -04:00

18 lines
385 B
Bash
Executable file

#!/bin/bash
set -euo pipefail
# Use poki to run the live-code bits within the markup files. See README.md for details.
# TODO: use globbing
names=$(echo *.rst.in | sed 's/\.rst\.in//g')
for name in $names; do
echo BUILDING $name
if [ -f $name.rst ]; then # Won't exist yet on first run
chmod u+w $name.rst
fi
poki < $name.rst.in > $name.rst
chmod 400 $name.rst
done