diff --git a/scripts/xhtmlize-single-file.sh b/scripts/xhtmlize-single-file.sh index 6a9f155..c9f7ce3 100644 --- a/scripts/xhtmlize-single-file.sh +++ b/scripts/xhtmlize-single-file.sh @@ -29,7 +29,7 @@ trap cleanup EXIT sed 7d "$html_file" | xmllint --format --encode UTF-8 --noent - | sd '^\t(?:\t)?' '' >"$tmp_file" { head -n7 "$tmp_file" | sd -s '/>' ' />' - cat tmp.css + cat "$OUTPUT_DIR/tmp.css" # shellcheck disable=SC2016 # these are regex statements, not shell expressions tail -n +8 "$tmp_file" \ | sd '
\n\t*<(code|samp)( |>)' '<$1$2' \ diff --git a/scripts/xhtmlize.sh b/scripts/xhtmlize.sh index b5bfd90..7691b79 100644 --- a/scripts/xhtmlize.sh +++ b/scripts/xhtmlize.sh @@ -8,12 +8,13 @@ set -e -u output_dir="$1" script_dir="$(dirname "$0")" -printf '\n' "$(htmlq -t style <"$output_dir/index.html")" >tmp.css +printf '\n' "$(htmlq -t style <"$output_dir/index.html")" >"$output_dir/tmp.css" cleanup() { - rm -f "tmp.css" + rm -f "$output_dir/tmp.css" } trap cleanup EXIT export XMLLINT_INDENT=' ' +export OUTPUT_DIR="$output_dir" find "$output_dir" -type f -name '*.html' | xargs -n1 sh "$script_dir/xhtmlize-single-file.sh" # done