aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2021-01-16 16:16:37 -0300
committerEuAndreh <eu@euandre.org>2021-01-16 16:17:34 -0300
commit13c4a7227424401a4ba75946d6f07a1b0b618292 (patch)
tree40cfa7f460fdedc5572d068a6e89b664891049d6
parentbash/util.sh: Change task() to output markdown (diff)
downloaddotfiles-13c4a7227424401a4ba75946d6f07a1b0b618292.tar.gz
dotfiles-13c4a7227424401a4ba75946d6f07a1b0b618292.tar.xz
fake-symlinks.sh: TODOs.sh: Use Perl to transform TODOs.md
-rwxr-xr-xbash/templates/build-aux/workflow/TODOs.sh8
-rw-r--r--bash/templates/build-aux/workflow/style.css32
-rw-r--r--bash/util.sh4
3 files changed, 17 insertions, 27 deletions
diff --git a/bash/templates/build-aux/workflow/TODOs.sh b/bash/templates/build-aux/workflow/TODOs.sh
index b8a3f29c..3ccd57bd 100755
--- a/bash/templates/build-aux/workflow/TODOs.sh
+++ b/bash/templates/build-aux/workflow/TODOs.sh
@@ -1,4 +1,4 @@
-#!/bin/sh -eux
+#!/bin/sh -eu
mkdir -p public
@@ -6,8 +6,10 @@ export PROJECT_UC="$1"
export PROJECT="$2"
export MAILING_LIST="$3"
-envsubst < build-aux/workflow/preamble.md | \
- cat - TODOs.md | \
+REGEX='s/^## (TODO|DOING|WAITING|MEETING|INACTIVE|NEXT|CANCELLED|DONE) (.*) \{(#.*?)\}$/## <span class="\1">\1<\/span> \2 {\3}\n<a class="header-anchor" href="\3">\3<\/a>\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 \
diff --git a/bash/templates/build-aux/workflow/style.css b/bash/templates/build-aux/workflow/style.css
index b68ff708..a4ac27a8 100644
--- a/bash/templates/build-aux/workflow/style.css
+++ b/bash/templates/build-aux/workflow/style.css
@@ -3,48 +3,36 @@
background-color: #ccc;
}
+ a.header-anchor {
+ opacity: 0.5;
+ }
+
/*
Replicate colors from:
https://git.euandreh.xyz/dotfiles/tree/spacemacs.el?id=fcd9f9c4ef399d45d54927382dc1cdde251ebb0a#n866
*/
- .TODO::after {
- content: "TODO";
+ .TODO {
color: brown;
}
- .DOING::after {
- content: "DOING";
+ .DOING {
color: yellowgreen;
}
- .WAITING::after {
- content: "WAITING";
- color: gray;
- }
-
- .MEETING::after {
- content: "MEETING";
+ .WAITING, .MEETING {
color: gray;
}
- .INACTIVE::after {
- content: "INACTIVE";
+ .INACTIVE {
color: orange;
}
- .NEXT::after {
- content: "NEXT";
+ .NEXT {
color: red;
}
- .CANCELLED::after {
- content: "CANCELLED";
- color: green;
- }
-
- .DONE::after {
- content: "DONE";
+ .CANCELLED, .DONE {
color: green;
}
</style>
diff --git a/bash/util.sh b/bash/util.sh
index c227da36..e9519f54 100644
--- a/bash/util.sh
+++ b/bash/util.sh
@@ -33,9 +33,9 @@ t() {
task() {
TITLE="${1:-FIXME}"
- printf '## <span class="TODO"></span> %s {#task-%s}\n- TODO in %s\n\n---\n\nFIXME\n' \
+ printf '## TODO %s {#task-%s}\n- TODO in %s\n\n---\n\nFIXME\n' \
"$TITLE" "$(uuidgen)" "$(date -I)" | \
vipe | \
- printf '%s\n\n%s\n%s\n' "$(head -n2 TODOs.md)" "$(cat -)" "$(tail -n+3 TODOs.md)" | \
+ printf '%s\n\n%s\n\n%s\n' "$(head -n2 TODOs.md)" "$(cat -)" "$(tail -n+3 TODOs.md)" | \
sponge TODOs.md
}