forked from gbtami/pychess-variants
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmd2html.sh
More file actions
executable file
·53 lines (45 loc) · 1.39 KB
/
md2html.sh
File metadata and controls
executable file
·53 lines (45 loc) · 1.39 KB
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.29';
find . -type f -name "*.html" -exec sed -i 's,'"$SRC"','"$DST"',g' {} \;
mkdir -p ../../templates/docs
mv -t ../../templates/docs *.html
# 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 sed -i 's,'"$SRC"','"$DST"',' {} \;
mkdir -p ../../templates/news
mv -t ../../templates/news *.html