40 lines
1.2 KiB
Bash
Executable file
40 lines
1.2 KiB
Bash
Executable file
#!/bin/sh
|
|
# Creates HTML version of the wiki.
|
|
|
|
echo "making HTML"
|
|
rm -rf html
|
|
mkdir html
|
|
|
|
cp report.html html
|
|
|
|
DATE=`date +"%D"`
|
|
FILELIST="filelist.html"
|
|
HEADER="<html><head><link rel=\"stylesheet\" href=\"style.css\"><title>LRS Wiki</title></head><body><h1>less_retarded_wiki</h1><a href=\"main.html\">main page</a>, <a href=\"$FILELIST\">file list</a>, <a href=\"lrs_wiki_full.html\">single page HTML</a>, <a href="report.html">report</a>, wiki last updated on $DATE<hr />"
|
|
FOOTER="<hr/><p>All content available under <a href=\"https://creativecommons.org/publicdomain/zero/1.0/\">CC0 1.0</a> (public domain). Send comments and corrections to drummyfish at disroot dot org. </p></body></html>"
|
|
|
|
echo "$HEADER <ul>" > html/$FILELIST
|
|
|
|
for f in *.md; do
|
|
fname=$(echo "$f" | sed "s/\.md//g")
|
|
|
|
echo "<li><a href="${fname}.html"> $fname </a></li>" >> html/$FILELIST
|
|
|
|
f2="html/${fname}.html"
|
|
|
|
echo $HEADER > $f2
|
|
cmark-gfm -e table $f | sed "s/\.md\"/.html\"/g" >> $f2
|
|
echo $FOOTER >> $f2
|
|
done
|
|
|
|
echo "$HEADER<a href="main.html">Go to main page.</a>$FOOTER" >> html/index.html
|
|
|
|
echo "</ul> $FOOTER" >> html/$FILELIST
|
|
|
|
cp style.css html/
|
|
|
|
./make_html_single.sh
|
|
|
|
cp ./lrs_wiki.html html/lrs_wiki_full.html
|
|
|
|
echo "done"
|