less_retarded_wiki/make_txt.sh
2023-11-12 01:41:59 +01:00

36 lines
745 B
Bash
Executable file

#!/bin/sh
# Creates an ASXII version of the wiki.
echo "making TXT"
rm -rf txt
mkdir txt
for f in *.md; do
echo $f
fname=$(echo "$f" | sed "s/\.md//g")
f2="txt/${fname}.txt"
cat $f | cmark-gfm -e table > __tmp.html && links -html-numbered-links 1 -dump __tmp.html | sed "s/file:\/\/.*less_retarded_wiki\///g" >> $f2
done
rm __tmp.html
echo "making single TXT"
echo "LESS RETARDED WIKI" > lrs.txt
echo "by drummyfish, released under CC0 1.0, public domain" >> lrs.txt
for f in txt/*.txt; do
echo $f
fname=$(echo "$f" | sed "s/\.txt//g" | sed "s/txt\///g")
echo "--------------------------------------------------------------------------------" >> lrs.txt
echo "$fname:" >> lrs.txt
cat $f >> lrs.txt
done
echo "done"