From dd04e676719e18674fac0005ae77b0ebcf9d94b7 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Mon, 8 Feb 2021 21:44:24 -0300 Subject: Add aux/ default files --- aux/workflow/README.sh | 30 +++++++++++++++++++++++ aux/workflow/TODOs.sh | 23 ++++++++++++++++++ aux/workflow/assert-todos.sh | 57 ++++++++++++++++++++++++++++++++++++++++++++ aux/workflow/preamble.md | 16 +++++++++++++ aux/workflow/style.css | 38 +++++++++++++++++++++++++++++ 5 files changed, 164 insertions(+) create mode 100755 aux/workflow/README.sh create mode 100755 aux/workflow/TODOs.sh create mode 100755 aux/workflow/assert-todos.sh create mode 100644 aux/workflow/preamble.md create mode 100644 aux/workflow/style.css (limited to 'aux/workflow') diff --git a/aux/workflow/README.sh b/aux/workflow/README.sh new file mode 100755 index 0000000..b9fa38e --- /dev/null +++ b/aux/workflow/README.sh @@ -0,0 +1,30 @@ +#!/bin/sh +set -eu + +mkdir -p public + +PROJECT_UC="$1" +PROJECT="$2" +README="${3:-README.md}" + +RELEASES_LIST="$(mktemp)" +for version in $(git tag); do + echo "- version [$version](https://git.euandreh.xyz/$PROJECT/snapshot/$PROJECT-$version.tar.gz), released in $(git log -1 --format=%cd --date=short "$version")" >> "$RELEASES_LIST" +done + +RELEASES="$(mktemp)" +if [ -s "$RELEASES_LIST" ]; then + printf '\n# Releases\n\n' >> "$RELEASES" + cat "$RELEASES_LIST" >> "$RELEASES" +fi + +cat "$README" "$RELEASES" | \ + pandoc --toc \ + --highlight-style pygments \ + --toc-depth=2 \ + -s \ + --metadata title="$PROJECT_UC - README" \ + --metadata lang=en \ + -r commonmark \ + -w html \ + > public/index.html diff --git a/aux/workflow/TODOs.sh b/aux/workflow/TODOs.sh new file mode 100755 index 0000000..5dbc761 --- /dev/null +++ b/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 < 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="$PROJECT_UC - TODOs" \ + --metadata lang=en \ + -r commonmark \ + -w html \ + -H aux/workflow/style.css \ + > public/TODOs.html diff --git a/aux/workflow/assert-todos.sh b/aux/workflow/assert-todos.sh new file mode 100755 index 0000000..203d465 --- /dev/null +++ b/aux/workflow/assert-todos.sh @@ -0,0 +1,57 @@ +#!/bin/sh +set -eu + +if git grep FIXME | grep -v '^TODOs.md' | grep -v '^aux/workflow/assert-todos.sh' | grep -v '^aux/docbook-xsl/'; then + echo "Found dangling FIXME markers on the project." + echo "You should write them down properly on TODOs.md." + exit 1 +fi + +awk -F'{#' ' +BEGIN { + exitstatus = 0 + h2flag = 0 + h2status = "" + prevline = "" + idx = 0 + delete ids[0] +} +h2flag == 1 { + split($0, l, " ") + timelinestatus = l[2] + if (h2status != timelinestatus) { + print "h2/timeline status mismatch for line " NR-1 + print prevline + print $0 + exitstatus = 1 + } + h2status = "" + h2flag = 0 +} + +/^## (TODO|DOING|WAITING|MEETING|INACTIVE|NEXT|CANCELLED|DONE)/ { + if (match($0, / \{#.*?\}$/) == 0) { + print "Missing ID for line " NR ":\n" $0 + exitstatus = 1 + } + id_with_prefix = substr($2, 0, length($2) - 1) + match(id_with_prefix, /^\w+-/) + id = substr(id_with_prefix, RLENGTH + 1) + if (id in arr) { + print "Duplicate ID: " id + exitstatus = 1 + } else { + arr[id] = 1 + } + + split($0, l, " ") + h2status = l[2] + h2flag = 1 + prevline = $0 +} + + +/^# Scratch$/ { + exit exitstatus +} +' TODOs.md diff --git a/aux/workflow/preamble.md b/aux/workflow/preamble.md new file mode 100644 index 0000000..c6ae56e --- /dev/null +++ b/aux/workflow/preamble.md @@ -0,0 +1,16 @@ +# About + +TODOs for $PROJECT_UC. + +See also [$PROJECT.euandreh.xyz](https://$PROJECT.euandreh.xyz/). + +Register a new one at +[~euandreh/$MAILING_LIST@lists.sr.ht](mailto:~euandreh/$MAILING_LIST@lists.sr.ht?subject=%5B$PROJECT%5D%20BUG%20or%20TASK%3A%20%3Cdescription%3E) +and see [existing discussions](https://lists.sr.ht/~euandreh/$MAILING_LIST?search=%5B$PROJECT%5D). + +*Você também pode escrever em português*. + +*Vous pouvez aussi écrire en français*. + +*Vi povas ankaŭ skribi esperante*. + diff --git a/aux/workflow/style.css b/aux/workflow/style.css new file mode 100644 index 0000000..ac0144c --- /dev/null +++ b/aux/workflow/style.css @@ -0,0 +1,38 @@ + -- cgit v1.2.3