less_retarded_wiki/make_html_single.sh

26 lines
803 B
Bash
Raw Normal View History

2022-05-15 21:07:27 +02:00
#!/bin/sh
# Creates a single HTML version of the wiki.
echo "making single HTML"
DATE=`date +"%D"`
2022-09-03 16:42:40 +02:00
echo "<html><head><link rel=\"stylesheet\" href=\"style.css\"><title>LRS Wiki</title></head><body><h1>less_retarded_wiki</h1><p>by drummyfish, generated on $DATE, available under <a href=\"https://creativecommons.org/publicdomain/zero/1.0/\">CC0 1.0</a> (public domain) </p><hr />" > lrs_wiki.html
2022-05-15 21:07:27 +02:00
echo "$HEADER <ul>" > html/$FILELIST
2022-05-15 21:11:48 +02:00
for f in `ls *.md | sort`; do
2022-05-15 21:07:27 +02:00
echo "processing $f"
fname=$(echo "$f" | sed "s/\.md//g")
echo "<span class=\"article\" id=\"$fname\">$fname</span><br />" >> lrs_wiki.html
cmark-gfm -e table $f | sed "s/\.md\"/\"/g" | sed "s/ href=\"/ href=\"#/g" >> lrs_wiki.html
echo "<hr />" >> lrs_wiki.html
done
echo "</body></html>" >> lrs_wiki.html
echo "done"