aboutsummaryrefslogtreecommitdiff
path: root/aux/workflow/TODOs.sh
diff options
context:
space:
mode:
Diffstat (limited to 'aux/workflow/TODOs.sh')
-rwxr-xr-xaux/workflow/TODOs.sh36
1 files changed, 18 insertions, 18 deletions
diff --git a/aux/workflow/TODOs.sh b/aux/workflow/TODOs.sh
index 96cb064..efc0b04 100755
--- a/aux/workflow/TODOs.sh
+++ b/aux/workflow/TODOs.sh
@@ -39,21 +39,21 @@ if [ -z "${PROJECT_UC:-}" ]; then
PROJECT_UC="$PROJECT"
fi
-TODOS_ADD_REGEX='s/^## (TODO|DOING|WAITING|MEETING|INACTIVE|NEXT|CANCELLED|DONE|WONTFIX) (.*) \{#(.*?)\}(.*)$/## <a href="#\3"><span class="\1">\1<\/span> \2<\/a>\4\n<pre class="header-anchor" id="\3">#\3<\/pre>\n/'
-TAGS_REGEX='s/tag:([\w-]+)/<span class="tag">\1<\/span>/g'
-TODOS_CLEANUP_REGEX1='s/(<a><a)/<a/'
-TODOS_CLEANUP_REGEX2='s/<\/a><\/a>/<\/a>/'
-sed -e "s:@PROJECT_UC@:$PROJECT_UC:g" \
- -e "s:@PROJECT@:$PROJECT:g" \
- -e "s:@MAILING_LIST@:$MAILING_LIST:g" \
- -e "s:@TLD@:$TLD:g" \
- < aux/workflow/preamble.md | \
- printf \
- '%s\n\n' \
- "$(cat - TODOs.md)" | \
- perl -pe "$TODOS_ADD_REGEX" | \
- perl -pe "$TAGS_REGEX" | \
+# shellcheck disable=1004
+IDS_REGEX='s:^## \(TODO\|DOING\|WAITING\|MEETING\|INACTIVE\|NEXT\|CANCELLED\|DONE\|WONTFIX\) \(.*\) {#\(.*\)}\(.*\)$:## <a href="#\3"><span class="\1">\1</span> \2</a>\4\
+<pre class="header-anchor" id="\3">#\3</pre>\
+:g'
+TAGS_REGEX='s|tag:\([a-z0-9-]*\)|<span class="tag">\1</span>|g'
+
+cat aux/workflow/preamble.md TODOs.md |
+ sed \
+ -e "s:@PROJECT_UC@:$PROJECT_UC:g" \
+ -e "s:@PROJECT@:$PROJECT:g" \
+ -e "s:@MAILING_LIST@:$MAILING_LIST:g" \
+ -e "s:@TLD@:$TLD:g" \
+ -e "$IDS_REGEX" \
+ -e "$TAGS_REGEX" |
pandoc \
--toc \
--highlight-style pygments \
@@ -64,8 +64,8 @@ sed -e "s:@PROJECT_UC@:$PROJECT_UC:g" \
-r commonmark \
-w html \
-H aux/workflow/favicon.html \
- -H aux/workflow/style.css \
- | \
- perl -pe "$TODOS_CLEANUP_REGEX1" | \
- perl -pe "$TODOS_CLEANUP_REGEX2" \
+ -H aux/workflow/style.css |
+ sed \
+ -e 's:<a><a:<a:g' \
+ -e 's:</a></a>:</a>:g' \
> "$OUTDIR/TODOs.html"