2 # Creates HTML version of the wiki.
12 cp pimp_my_lrs.html html
16 FILECOUNT
=`ls *.md | wc -l`
18 RANDPAGE
="random_page"
19 HEADER1
="<html><head><link rel=\"stylesheet\" href=\"style.css\"><title> LRS Wiki: "
20 HEADER2
="</title></head><body><h1>less_retarded_wiki</h1><span class=\"nav\"><a href=\"main.html\">main page</a>, <a class=\"notdead\" href=\"$FILELIST.html\">file list ($FILECOUNT)</a>, <a class=\"notdead\" href=\"https://git.coom.tech/drummyfish/less_retarded_wiki/archive/master.zip\">source</a>, <a class=\"notdead\" href=\"lrs_wiki.7z\">all in md+txt+html+pdf</a>, <a class=\"notdead\" href=\"https://git.coom.tech/drummyfish/less_retarded_wiki.atom\">commit RSS feed</a>, <a class=\"notdead\" href=\"report.html\">report abuse</a>, <a class=\"notdead\" href=\"wiki_stats.html\">stats</a>, <a class=\"notdead\" href=\"$RANDPAGE.html\">random article</a>, <a class=\"notdead\" id=\"fancylink\" href=\"pimp_my_lrs.html?p=main.html&s=style_fancy.css\">consoomer version</a></span><hr />"
21 FOOTER
="<hr /><p> Powered by nothing. All content available under <a class=\"notdead\" 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>"
28 cat tmp.txt | shuf
> tmp2.txt
30 printf "# Random Article\n\nPlease kindly click random link.\n\n" >> $RANDPAGE.md
33 echo "[*]($f)" >> $RANDPAGE.md
38 printf "# Wiki Files\n\nThis is an autogenerated page listing all pages.\n\n" > $FILELIST.md
43 fname
=$
(echo "$f" |
sed "s/\.md//g")
44 if [ "$firstFile" = true
] ; then
47 printf " -- " >> $FILELIST.md
50 printf "**[$fname]($f)** ($(cat $f | wc -l))" >> $FILELIST.md
54 fname
=$
(echo "$f" |
sed "s/\.md//g")
55 f2
="html/${fname}.html"
56 echo "$HEADER1 $fname $HEADER2" > $f2
57 cmark-gfm
-e table
$f |
sed "s/\.md\"/.html\"/g" >> $f2
61 # this uses a C program to mark dead links, you can optionally remove this
62 gcc
-O3 mark_dead_links.c
-o mark_dead_links
64 cp ..
/mark_dead_links .
67 cat $f | .
/mark_dead_links
> tmp
75 echo "$HEADER1 redirect $HEADER2<a href="main.html
">Go to main page.</a>$FOOTER" >> html
/index.html
77 echo "</ul> $FOOTER" >> html
/$FILELIST
81 cp .
/lrs_wiki.html html
/lrs_wiki_full.html