aboutsummaryrefslogblamecommitdiff
path: root/aux/workflow/TODOs.sh
blob: 80059ee4b15f1c5b29d5f6b618eada3d4f9784e5 (plain) (tree)
1
2
3
4
5
6
7
8
9




               


                 
                        
 
                                                                                                                                                                                                       
 

                                                          




















                                                                                  
#!/bin/sh
set -eu

mkdir -p public

PROJECT_UC="$1"
PROJECT="$2"
MAILING_LIST="$3"
TLD="$(cat aux/tld.txt)"

TODOS_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/'

TAGS_REGEX='s/tag:([\w-]+)/<span class="tag">\1<\/span>/g'

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%s' \
		"$(cat -)" \
		"$(perl -pe "$TODOS_REGEX" TODOs.md | perl -pe "$TAGS_REGEX")" | \
	pandoc \
		--toc                                  \
		--highlight-style pygments             \
		--toc-depth=2                          \
		-s                                     \
		--metadata title="$PROJECT_UC - TODOs" \
		--metadata lang=en                     \
		-r commonmark                          \
		-w html                                \
		-H aux/workflow/favicon.html           \
		-H aux/workflow/style.css              \
		> public/TODOs.html