less_retarded_wiki/make_txt.sh

39 lines
763 B
Bash
Raw Normal View History

2022-08-28 17:56:10 +02:00
#!/bin/sh
# Creates an ASXII version of the wiki.
echo "making TXT"
2023-12-14 23:38:44 +01:00
./make_stats.sh
2022-08-28 17:56:10 +02:00
rm -rf txt
mkdir txt
for f in *.md; do
echo $f
fname=$(echo "$f" | sed "s/\.md//g")
f2="txt/${fname}.txt"
2023-11-12 01:41:59 +01:00
cat $f | cmark-gfm -e table > __tmp.html && links -html-numbered-links 1 -dump __tmp.html | sed "s/file:\/\/.*less_retarded_wiki\///g" >> $f2
2022-08-28 17:56:10 +02:00
done
2023-11-12 01:41:59 +01:00
rm __tmp.html
2022-08-28 17:56:10 +02:00
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"