2007-10-14 18:14:33 +02:00
|
|
|
#!/bin/bash
|
|
|
|
# Quick hack to generate handbook.txt from pmwiki
|
|
|
|
# Johannes Winkelmann, jw at tks6 dot net
|
|
|
|
|
|
|
|
INFILE=handbook.in
|
|
|
|
OUTFILE=handbook.txt
|
2020-10-20 22:31:44 +02:00
|
|
|
CRUX_VERSION=3.6
|
2007-10-14 18:14:33 +02:00
|
|
|
TITLE="HANDBOOK FOR CRUX $CRUX_VERSION"
|
2019-06-05 17:20:01 +02:00
|
|
|
URL="https://crux.nu/Main/Handbook${CRUX_VERSION/\./-}?action=print"
|
2007-10-14 18:14:33 +02:00
|
|
|
|
|
|
|
set -x
|
2019-06-20 01:37:09 +02:00
|
|
|
links -dump $URL > $INFILE
|
2016-11-17 21:44:02 +01:00
|
|
|
cat $INFILE|while read n; do
|
|
|
|
if [ -n "$intext" ]; then
|
2007-10-14 18:14:33 +02:00
|
|
|
cat
|
2016-11-17 21:44:02 +01:00
|
|
|
elif [ "$n" = "1. Preface" ]; then
|
2007-10-14 18:14:33 +02:00
|
|
|
echo "$TITLE"
|
2016-11-17 21:44:02 +01:00
|
|
|
echo "";
|
|
|
|
echo " $n";
|
|
|
|
intext="yes";
|
|
|
|
fi
|
2007-10-14 18:14:33 +02:00
|
|
|
done > $OUTFILE
|
|
|
|
|
|
|
|
rm $INFILE
|