mirror of
https://git.sr.ht/~seirdy/seirdy.one
synced 2024-11-23 21:02:09 +00:00
Decrease markup indentation by one level
This commit is contained in:
parent
fb741f3e6f
commit
9433bca2b7
2 changed files with 3 additions and 2 deletions
|
@ -11,6 +11,7 @@
|
|||
# xmllint ruins inline CSS so delete the inline CSS and re-insert it.
|
||||
# xmllint also adds extra whitespace around <pre><code> which we remove
|
||||
# with "sd". I chose sd since it handles newlines well.
|
||||
# It also decreases indents by one level
|
||||
|
||||
set -e -u
|
||||
|
||||
|
@ -24,7 +25,7 @@ cleanup() {
|
|||
trap cleanup EXIT
|
||||
|
||||
trap cleanup EXIT
|
||||
sed 7d "$html_file" | xmllint --format --encode UTF-8 --noent - -o "$tmp_file"
|
||||
sed 7d "$html_file" | xmllint --format --encode UTF-8 --noent - | sd '^\t' '' >"$tmp_file"
|
||||
{
|
||||
head -n7 "$tmp_file"
|
||||
cat tmp.css
|
||||
|
|
|
@ -7,7 +7,7 @@ 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
|
||||
printf '\t<style>%s</style>\n' "$(htmlq -t style <"$output_dir/index.html")" >tmp.css
|
||||
cleanup() {
|
||||
rm -f "tmp.css"
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue