blob: ad362c7cb4607aaebbe0ca99d7eb17cac4b02241 (
plain)
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
54
55
56
57
58
59
60
|
#!/bin/bash
set -euo pipefail
if [ "$(pwd)" != "$HOME/src/zisp/html" ]
then
echo >&2 "Call this from within the Zisp HTML directory."
exit 1
fi
md2ht() {
src=$1
dst=$2
if ! [ -f "$src" ]
then
echo >&2 "File not found: $src"
continue
fi
echo "$src -> $dst"
{
title=$(sed 's/# //; q' "$src")
sed "s/__TITLE__/$title/" prelude.html
echo "<body>"
markdown2 "$src" -x fenced-code-blocks,highlightjs-lang,tables
echo "</body>"
} > "$dst"
}
md2ht index.md zisp/index.html
cp style.css zisp/
for file in ../notes/*.md
do
name=${file#../notes/}
name=${name%.md}
md2ht "$file" "zisp/notes/$name.html"
done
shopt -s globstar
for file in ../docs/**/*.md
do
name=${file#../docs/}
name=${name%.md}
dir=${file#../}
dir=${dir%/*}
mkdir -p "zisp/$dir"
md2ht "$file" "zisp/docs/$name.html"
done
for file in ../docs/**/*.txt
do
dir=${file#../}
dir=${dir%/*}
mkdir -p "zisp/$dir"
dest=zisp/docs/${file#../docs/}
cp "$file" "$dest"
done
rsync -a zisp tk:/var/www/html
|