1
0
Fork 0
mirror of https://git.sr.ht/~seirdy/seirdy.one synced 2024-11-27 14:12:09 +00:00
seirdy.one/scripts/xhtmlize.sh
Rohan Kumar c1f991efff
xhtmlize: switch back to using xmllint
Switch back to using xmllint, but now extract + replace the CSS to
address the escaping.
2022-06-01 22:11:40 -07:00

19 lines
448 B
Bash

#!/bin/sh
# takes an arg for the output dir.
# Runs xhtmlize-single-file.sh on every single html file in the output dir.
set -e -u
output_dir="$1"
script_dir="$(dirname "$0")"
printf '\t\t<style>%s</style>\n' "$(htmlq -t style <"$output_dir/index.html")" >tmp.css
cleanup() {
rm -f "tmp.css"
}
trap cleanup EXIT
export XMLLINT_INDENT=' '
find "$output_dir" -type f -name '*.html' \
-exec sh "$script_dir/xhtmlize-single-file.sh" {} \;
# done