1function last_edited_date() {
2 jj log "$1" \
3 -T 'self.committer().timestamp().format("%Y-%m-%d")' \
4 --no-graph -n 1
5}
6
7function preprocessing() {
8 perl -p -e 's#asciinema\(([a-zA-Z0-9]+)\)#<script async id="asciicast-\1" src="https://asciinema.org/a/\1.js"></script>#g'
9}
10
11function pandoc_cmd() {
12 pandoc --standalone --template template.html - "$@"
13}
14
15content="$1"
16output="$2"
17
18preprocessing < "$content" |
19 pandoc_cmd --metadata footer="Last modified: $(last_edited_date "$content")" -o "$output"