aboutsummaryrefslogtreecommitdiffstats
path: root/doc/updt.sh
blob: a6292c832fbdc618b99fc5b6a0ef07729a2f3002 (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
#!/bin/sh

fmd() {
cat << EOC
<html>
<head>
  <link rel="stylesheet" type="text/css" href="doc.css">
  <meta charset="UTF-8">
</head>
<body>
$(cat)
</body>
</html>
EOC
}


for x in *.md; do
  t=$(stat -c %Y $x)
  t=$(git log -n 1 --format=%ct $x)
  d=$(LANG= date -d @$t +"%d %B %Y")
  sed -i "s/^\(    Date: *\).*/\1$d/" $x
  markdown -f toc,autolink $x | fmd > ${x%%.md}.html
done