Update
[less_retarded_wiki.git] / make_txt.sh
blob1d4c990bd842ef32674da67ac2a5e002986f1592
1 #!/bin/sh
2 # Creates an ASCII version of the wiki.
4 echo "making TXT"
6 ./make_stats.sh
8 rm -rf txt
9 mkdir txt
11 for f in *.md; do
12 echo $f
14 fname=$(echo "$f" | sed "s/\.md//g")
15 f2="txt/${fname}.txt"
17 cat $f | cmark-gfm -e table > __tmp.html && links -html-numbered-links 1 -dump __tmp.html | sed "s/file:\/\/.*less_retarded_wiki\///g" >> $f2
18 done
20 rm __tmp.html
22 echo "making single TXT"
24 echo "LESS RETARDED WIKI" > lrs_wiki.txt
25 echo "by drummyfish, released under CC0 1.0, public domain" >> lrs_wiki.txt
27 for f in txt/*.txt; do
28 echo $f
30 fname=$(echo "$f" | sed "s/\.txt//g" | sed "s/txt\///g")
32 echo "--------------------------------------------------------------------------------" >> lrs_wiki.txt
33 echo "$fname:" >> lrs_wiki.txt
35 cat $f >> lrs_wiki.txt
36 done
38 echo "done"