From 71b9b9c61dccffac975c10f74e86dcdc4f91c17c Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Thu, 21 Jan 2021 22:13:23 -0300 Subject: Add build-aux/workflow/ to generated TODOs.html from TODOs.md --- .gitignore | 1 + Makefile | 7 +++++++ build-aux/workflow/TODOs.sh | 23 +++++++++++++++++++++++ build-aux/workflow/preamble.md | 15 +++++++++++++++ build-aux/workflow/style.css | 38 ++++++++++++++++++++++++++++++++++++++ 5 files changed, 84 insertions(+) create mode 100644 .gitignore create mode 100755 build-aux/workflow/TODOs.sh create mode 100644 build-aux/workflow/preamble.md create mode 100644 build-aux/workflow/style.css diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..87174b6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/public/ diff --git a/Makefile b/Makefile index 96cdace..e344d38 100644 --- a/Makefile +++ b/Makefile @@ -13,3 +13,10 @@ install: check: sh tests/all.sh + +public: + sh build-aux/workflow/TODOs.sh remembering remembering public-inbox + pandoc -s --metadata title='remembering - EuAndreh' -o public/index.html README.md + +clean: + rm -rf public/ diff --git a/build-aux/workflow/TODOs.sh b/build-aux/workflow/TODOs.sh new file mode 100755 index 0000000..4a9eb65 --- /dev/null +++ b/build-aux/workflow/TODOs.sh @@ -0,0 +1,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) (.*) \{#(.*?)\}$/## \1<\/span> \2<\/a>\n#\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 diff --git a/build-aux/workflow/preamble.md b/build-aux/workflow/preamble.md new file mode 100644 index 0000000..ac75d9d --- /dev/null +++ b/build-aux/workflow/preamble.md @@ -0,0 +1,15 @@ +# About + +TODOs for $PROJECT_UC. + +See also [$PROJECT.euandreh.xyz](https://$PROJECT.euandreh.xyz/). + +Register a new one: +[~euandreh/$MAILING_LIST@lists.sr.ht](mailto:~euandreh/$MAILING_LIST@lists.sr.ht?subject=BUG%20or%20TASK%3A%20%3Cdescription%3E). + +*Você também pode escrever em português*. + +*Vous pouvez aussi écrire en français*. + +*Vi povas ankaŭ skribi esperante*. + diff --git a/build-aux/workflow/style.css b/build-aux/workflow/style.css new file mode 100644 index 0000000..ac0144c --- /dev/null +++ b/build-aux/workflow/style.css @@ -0,0 +1,38 @@ + -- cgit v1.2.3