From 4641e27bda25c6a85ddc0d3b35f1b58fe4ec2e49 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Sat, 25 Mar 2023 17:43:52 -0300 Subject: share/aux-repo/: Add existing files AS-IS --- share/aux-repo/aux/workflow/TODOs.sh | 65 ++++++++++++++++++++++ share/aux-repo/aux/workflow/favicon.svg | 62 +++++++++++++++++++++ share/aux-repo/aux/workflow/head.html | 2 + share/aux-repo/aux/workflow/md2html.sh | 87 ++++++++++++++++++++++++++++++ share/aux-repo/aux/workflow/preamble.md.in | 16 ++++++ share/aux-repo/aux/workflow/style.css | 80 +++++++++++++++++++++++++++ 6 files changed, 312 insertions(+) create mode 100755 share/aux-repo/aux/workflow/TODOs.sh create mode 100644 share/aux-repo/aux/workflow/favicon.svg create mode 100644 share/aux-repo/aux/workflow/head.html create mode 100755 share/aux-repo/aux/workflow/md2html.sh create mode 100644 share/aux-repo/aux/workflow/preamble.md.in create mode 100644 share/aux-repo/aux/workflow/style.css (limited to 'share/aux-repo/aux/workflow') diff --git a/share/aux-repo/aux/workflow/TODOs.sh b/share/aux-repo/aux/workflow/TODOs.sh new file mode 100755 index 0000000..8b06d15 --- /dev/null +++ b/share/aux-repo/aux/workflow/TODOs.sh @@ -0,0 +1,65 @@ +#!/bin/sh +set -eu + +TLD="$(cat aux/tld.txt)" +PROJECT_UC= +while getopts 'n:N:m:o:' flag; do + case "$flag" in + n) + PROJECT="$OPTARG" + ;; + N) + PROJECT_UC="$OPTARG" + ;; + m) + MAILING_LIST="$OPTARG" + ;; + o) + OUTDIR="$OPTARG" + ;; + *) + exit 2 + ;; + esac +done +shift $((OPTIND - 1)) + +assert_arg() { + if [ -z "$1" ]; then + echo "Missing $2" >&2 + exit 2 + fi +} + +assert_arg "${PROJECT:-}" '-n PROJECT' +assert_arg "${MAILING_LIST:-}" '-m MAILING_LIST' +assert_arg "${OUTDIR:-}" '-o OUTDIR' + +if [ -z "${PROJECT_UC:-}" ]; then + PROJECT_UC="$PROJECT" +fi + + +td -H | + cat aux/workflow/preamble.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" | + 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 | + sed \ + -e 's:::g' + +# FIXME: check TODOs.sh from euandre.org diff --git a/share/aux-repo/aux/workflow/favicon.svg b/share/aux-repo/aux/workflow/favicon.svg new file mode 100644 index 0000000..ce566b2 --- /dev/null +++ b/share/aux-repo/aux/workflow/favicon.svg @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/share/aux-repo/aux/workflow/head.html b/share/aux-repo/aux/workflow/head.html new file mode 100644 index 0000000..3902690 --- /dev/null +++ b/share/aux-repo/aux/workflow/head.html @@ -0,0 +1,2 @@ + + diff --git a/share/aux-repo/aux/workflow/md2html.sh b/share/aux-repo/aux/workflow/md2html.sh new file mode 100755 index 0000000..957bfc2 --- /dev/null +++ b/share/aux-repo/aux/workflow/md2html.sh @@ -0,0 +1,87 @@ +#!/bin/sh +set -eu + +. aux/lib.sh + +usage() { + cat <<-'EOF' + Usage: + aux/workflow/md2html.sh -N NAME_UC -T TITLE [-D TOC_DEPTH] < FILE.md + aux/workflow/md2html.sh -h + EOF +} + +help() { + cat <<-'EOF' + + Options: + -N NAME_UC the uppercased name of the project + -T TITLE the required title of the generated HTML + document + -D TOC_DEPTH the depth of the generated table of + contents (default: 2) + -h, --help show this message + + + Read markdown text from STDIN and emit HTML to STDOUT. + EOF +} + +for flag in "$@"; do + case "$flag" in + --) + break + ;; + --help) + usage + help + exit + ;; + *) + ;; + esac +done + +TOC_DEPTH=2 +while getopts 'N:T:D:h' flag; do + case "$flag" in + N) + NAME_UC="$OPTARG" + ;; + T) + TITLE="$OPTARG" + ;; + D) + TOC_DEPTH="$OPTARG" + ;; + h) + usage + help + exit + ;; + *) + usage >&2 + exit 2 + ;; + esac +done +shift $((OPTIND - 1)) + +eval "$(assert_arg "${NAME_UC:-}" '-T TITLE')" +eval "$(assert_arg "${TITLE:-}" '-T TITLE')" + +THE_LANG='en' + +ALTERNATES=/dev/null + +pandoc \ + -s \ + --toc \ + --toc-depth="$TOC_DEPTH" \ + --highlight-style=pygments \ + --metadata lang="$THE_LANG" \ + --metadata title="$TITLE - $NAME_UC" \ + -r commonmark \ + -w html \ + -H aux/workflow/head.html \ + -H "$ALTERNATES" diff --git a/share/aux-repo/aux/workflow/preamble.md.in b/share/aux-repo/aux/workflow/preamble.md.in new file mode 100644 index 0000000..1d17997 --- /dev/null +++ b/share/aux-repo/aux/workflow/preamble.md.in @@ -0,0 +1,16 @@ +# About + +TODOs for [@PROJECT_UC@](https://@TLD@/@PROJECT@/en/). + +Register a new one at +[@MAILING_LIST@](mailto:@MAILING_LIST@?subject=%5B@PROJECT@%5D%20BUG%20or%20TASK%3A%20%3Cdescription%3E) +and see [existing discussions](@LIST_SEARCH@). + +*Você também pode escrever em português*. + +*Vous pouvez aussi écrire en français*. + +*Vi povas ankaŭ skribi esperante*. + +*Tu también puedes escribir en español*. + diff --git a/share/aux-repo/aux/workflow/style.css b/share/aux-repo/aux/workflow/style.css new file mode 100644 index 0000000..4f3c83e --- /dev/null +++ b/share/aux-repo/aux/workflow/style.css @@ -0,0 +1,80 @@ +html { + line-height: 1.5; +} + +body { + max-width: 800px; + margin: 0 auto 0 auto; +} + +hr { + background-color: #ccc; +} + +.header-anchor { + opacity: 0.5; + display: inline-block; +} + +.tag { + font-family: monospace; + font-size: 70%; + background-color: lightgray; + color: black; + padding: 3px; + border-radius: 5px; +} + +.TODO { + color: brown; +} + +.DOING { + color: yellowgreen; +} + +.WAITING, .MEETING { + color: orange; +} + +.INACTIVE { + color: gray; +} + +.NEXT { + color: red; +} + +.CANCELLED, .DONE, .WONTFIX { + color: green; +} + +pre, code { + background-color: #ddd; + border-radius: 5px; + padding: 3px; +} + +pre > code { + overflow: auto; + white-space: pre; +} + +@media(prefers-color-scheme: dark) { + :root { + color: white; + background-color: black; + } + + a { + color: hsl(211, 100%, 60%); + } + + a:visited { + color: hsl(242, 100%, 80%); + } + + pre, code { + background-color: #222; + } +} -- cgit v1.2.3