1
0
Fork 0
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
blog/content/images/forgetting-dns6/make.sh

13 lines
324 B
Bash

#!/bin/sh
set -eux
while IFS=: read fn layers viewbox; do
# Pass 1: pick correct layers
sed -re "/$layers/"' { N; s/none/inline/; }' source.svg > "$fn"
# Pass 2: crop images
inkscape "$fn" -D --export-overwrite
# Pass 3: add margins
sed -ri 's/^ viewBox="[^"]*"/ viewBox="'"$viewbox"'"/' "$fn"
done < layers.map