aboutsummaryrefslogtreecommitdiff
path: root/build-aux/workflow/TODOs.sh
blob: 4a9eb65d19c6a98c841c77616b0842e7aa3d0fc0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh
set -eu

mkdir -p public

export PROJECT_UC="$1"
export PROJECT="$2"
export MAILING_LIST="$3"

REGEX='s/^## (TODO|DOING|WAITING|MEETING|INACTIVE|NEXT|CANCELLED|DONE) (.*) \{#(.*?)\}$/## <a href="#\3"><span class="\1">\1<\/span> \2<\/a>\n<span class="header-anchor" id="\3">#\3<\/span>\n/'

envsubst < build-aux/workflow/preamble.md                      | \
  printf '%s\n\n%s' "$(cat -)" "$(perl -pe "$REGEX" TODOs.md)" | \
  pandoc --toc                           \
         --highlight-style pygments      \
         --toc-depth=2                   \
         -s                              \
         --metadata title="$1 - TODOs"   \
         --metadata lang=en              \
         -H build-aux/workflow/style.css \
         -r markdown                     \
         -w html                         \
         > public/TODOs.html