forked from gbtami/pychess-variants
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmd2html.sh
executable file
·45 lines (35 loc) · 1.24 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
#!/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
for lang in es hu it pt fr zh_CN zh_TW; do
if [ -e "$lang/$f" ]; then
showdown makehtml -i "$lang/$f" -o "$(basename -- "$f" .md).$lang.html" --flavor github
else
showdown makehtml -i "$f" -o "$(basename -- "$f" .md).$lang.html" --flavor github
fi
done
done
SRC='https://github.com/gbtami/pychess-variants/blob/master';
#DST='https://www.pychess.org';
DST='https://cdn.jsdelivr.net/gh/gbtami/pychess-variants\@1.9.19';
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
for lang in es hu it pt fr zh_CN zh_TW; do
if [ -e "$lang/$f" ]; then
showdown makehtml -i "$lang/$f" -o "$(basename -- "$f" .md).$lang.html" --flavor github
else
showdown makehtml -i "$f" -o "$(basename -- "$f" .md).$lang.html" --flavor github
fi
done
done
find . -type f -name "*.html" -exec perl -pi -e s,$SRC,$DST,g '{}' +
mkdir -p ../../templates/news
mv *.html ../../templates/news