less_retarded_wiki/make_txt.sh

39 lines
788 B
Bash
Raw Normal View History

2022-08-28 17:56:10 +02:00
#!/bin/sh
2024-02-24 19:26:17 +01:00
# Creates an ASCII version of the wiki.
2022-08-28 17:56:10 +02:00
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"
2024-02-24 19:26:17 +01:00
echo "LESS RETARDED WIKI" > lrs_wiki.txt
echo "by drummyfish, released under CC0 1.0, public domain" >> lrs_wiki.txt
2022-08-28 17:56:10 +02:00
for f in txt/*.txt; do
echo $f
fname=$(echo "$f" | sed "s/\.txt//g" | sed "s/txt\///g")
2024-02-24 19:26:17 +01:00
echo "--------------------------------------------------------------------------------" >> lrs_wiki.txt
echo "$fname:" >> lrs_wiki.txt
2022-08-28 17:56:10 +02:00
2024-02-24 19:26:17 +01:00
cat $f >> lrs_wiki.txt
2022-08-28 17:56:10 +02:00
done
echo "done"