forked from SriMethan/liantichess
-
Notifications
You must be signed in to change notification settings - Fork 3
/
md2html.sh
executable file
·53 lines (37 loc) · 1.3 KB
/
md2html.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/sh
# Learn docs
cd static/docs
export PATH="../../node_modules/.bin/:$PATH"
for f in *.md; do
showdown makehtml -i "$f" -o "$(basename -- "$f" .md).html" --flavor github
done
for f in es/*.md; do
showdown makehtml -i "$f" -o "$(basename -- "$f" .md).es.html" --flavor github
done
for f in hu/*.md; do
showdown makehtml -i "$f" -o "$(basename -- "$f" .md).hu.html" --flavor github
done
for f in it/*.md; do
showdown makehtml -i "$f" -o "$(basename -- "$f" .md).it.html" --flavor github
done
for f in pt/*.md; do
showdown makehtml -i "$f" -o "$(basename -- "$f" .md).pt.html" --flavor github
done
for f in fr/*.md; do
showdown makehtml -i "$f" -o "$(basename -- "$f" .md).fr.html" --flavor github
done
showdown makehtml -i "zh/intro.md" -o "intro.zh.html" --flavor github
SRC='https://github.com/gbtami/pychess-variants/blob/master';
#DST='https://www.pychess.org';
DST='https://cdn.jsdelivr.net/gh/gbtami/pychess-variants\@1.6.64';
find . -type f -name "*.html" -exec perl -pi -e s,$SRC,$DST,g '{}' +
mkdir -p ../../templates/docs
mv *.html ../../templates/docs
# News
cd ../news
for f in *.md; do
showdown makehtml -i "$f" -o "$(basename -- "$f" .md).html" --flavor github
done
find . -type f -name "*.html" -exec perl -pi -e s,$SRC,$DST,g '{}' +
mkdir -p ../../templates/news
mv *.html ../../templates/news