#!/bin/sh
# Download and slightly adjust the input file.
# There's one occurence where there's a newline missing, which throws our awk script off.
# Might as well fix it here rather than making the awk script more complex.
curl https://problemkaputt.de/psx-spx.htm |
dos2unix |
sed 's|
\n|' > psx-spx.html
# Run the awk script to generate all of the .md files, as well as the second pass scripts.
gawk -f psx-spx-pass1.awk psx-spx.html
# Invoke the second pass generated by the first pass script, to adjust all the cross references.
. ./run-pass2.sh
# Cleanup
rm psx-spx.html run-pass2.sh psx-spx-pass2.sed
mv *.md ..
|