From 3c118c78dba38ae1155ac0f403ed257628541ef1 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Sat, 16 Jan 2021 16:07:09 -0300 Subject: Use Perl to handle header anchors in TODOs.md --- build-aux/workflow/TODOs.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'build-aux/workflow/TODOs.sh') 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) (.*) \{(#.*?)\}$/## \1<\/span> \2 {\3}\n\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 \ -- cgit v1.2.3