diff options
author | EuAndreh <eu@euandre.org> | 2021-01-16 16:07:09 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2021-01-16 16:12:25 -0300 |
commit | 3c118c78dba38ae1155ac0f403ed257628541ef1 (patch) | |
tree | e671d95abbbccc2667dc2150f7ccf6295635e1ed /build-aux/workflow/TODOs.sh | |
parent | Move from TODOs.rst to TODOs.md (diff) | |
download | server-3c118c78dba38ae1155ac0f403ed257628541ef1.tar.gz server-3c118c78dba38ae1155ac0f403ed257628541ef1.tar.xz |
Use Perl to handle header anchors in TODOs.md
Diffstat (limited to 'build-aux/workflow/TODOs.sh')
-rwxr-xr-x | build-aux/workflow/TODOs.sh | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/build-aux/workflow/TODOs.sh b/build-aux/workflow/TODOs.sh index b8a3f29..3ccd57b 100755 --- a/build-aux/workflow/TODOs.sh +++ b/build-aux/workflow/TODOs.sh @@ -1,4 +1,4 @@ -#!/bin/sh -eux +#!/bin/sh -eu mkdir -p public @@ -6,8 +6,10 @@ export PROJECT_UC="$1" export PROJECT="$2" export MAILING_LIST="$3" -envsubst < build-aux/workflow/preamble.md | \ - cat - TODOs.md | \ +REGEX='s/^## (TODO|DOING|WAITING|MEETING|INACTIVE|NEXT|CANCELLED|DONE) (.*) \{(#.*?)\}$/## <span class="\1">\1<\/span> \2 {\3}\n<a class="header-anchor" href="\3">\3<\/a>\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 \ |