Add tools/gencommit.sh which will only generate the commithash SVG

This is useful so we aren't wasting cycles generating examples that
don't need to be generated and we just cut to the chase

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
2024-05-30 12:35:38 -07:00
parent 19578536aa
commit 2726f2d80f
3 changed files with 49 additions and 42 deletions

View File

@@ -1,42 +1,42 @@
<svg width="256" height="160" xmlns="http://www.w3.org/2000/svg"> <svg width="256" height="160" xmlns="http://www.w3.org/2000/svg">
<rect x="0" y="0" width="32" height="32" fill="hsl(240.00,100.00%,67.00%)" /> <rect x="0" y="0" width="32" height="32" fill="hsl(300.00,100.00%,3.00%)" />
<rect x="32" y="0" width="32" height="32" fill="hsl(240.00,100.00%,87.00%)" /> <rect x="32" y="0" width="32" height="32" fill="hsl(300.00,100.00%,30.00%)" />
<rect x="64" y="0" width="32" height="32" fill="hsl(240.00,100.00%,67.00%)" /> <rect x="64" y="0" width="32" height="32" fill="hsl(300.00,100.00%,17.00%)" />
<rect x="96" y="0" width="32" height="32" fill="hsl(240.00,100.00%,90.00%)" /> <rect x="96" y="0" width="32" height="32" fill="hsl(300.00,100.00%,23.00%)" />
<rect x="128" y="0" width="32" height="32" fill="hsl(240.00,100.00%,57.00%)" /> <rect x="128" y="0" width="32" height="32" fill="hsl(300.00,100.00%,27.00%)" />
<rect x="160" y="0" width="32" height="32" fill="hsl(240.00,100.00%,63.00%)" /> <rect x="160" y="0" width="32" height="32" fill="hsl(300.00,100.00%,17.00%)" />
<rect x="192" y="0" width="32" height="32" fill="hsl(240.00,100.00%,63.00%)" /> <rect x="192" y="0" width="32" height="32" fill="hsl(300.00,100.00%,10.00%)" />
<rect x="224" y="0" width="32" height="32" fill="hsl(240.00,100.00%,63.00%)" /> <rect x="224" y="0" width="32" height="32" fill="hsl(300.00,100.00%,20.00%)" />
<rect x="0" y="32" width="32" height="32" fill="hsl(240.00,100.00%,93.00%)" /> <rect x="0" y="32" width="32" height="32" fill="hsl(300.00,100.00%,33.00%)" />
<rect x="32" y="32" width="32" height="32" fill="hsl(240.00,100.00%,87.00%)" /> <rect x="32" y="32" width="32" height="32" fill="hsl(300.00,100.00%,33.00%)" />
<rect x="64" y="32" width="32" height="32" fill="hsl(240.00,100.00%,57.00%)" /> <rect x="64" y="32" width="32" height="32" fill="hsl(300.00,100.00%,17.00%)" />
<rect x="96" y="32" width="32" height="32" fill="hsl(240.00,100.00%,80.00%)" /> <rect x="96" y="32" width="32" height="32" fill="hsl(300.00,100.00%,3.00%)" />
<rect x="128" y="32" width="32" height="32" fill="hsl(240.00,100.00%,100.00%)" /> <rect x="128" y="32" width="32" height="32" fill="hsl(300.00,100.00%,27.00%)" />
<rect x="160" y="32" width="32" height="32" fill="hsl(240.00,100.00%,100.00%)" /> <rect x="160" y="32" width="32" height="32" fill="hsl(300.00,100.00%,30.00%)" />
<rect x="192" y="32" width="32" height="32" fill="hsl(240.00,100.00%,53.00%)" /> <rect x="192" y="32" width="32" height="32" fill="hsl(300.00,100.00%,20.00%)" />
<rect x="224" y="32" width="32" height="32" fill="hsl(240.00,100.00%,80.00%)" /> <rect x="224" y="32" width="32" height="32" fill="hsl(300.00,100.00%,30.00%)" />
<rect x="0" y="64" width="32" height="32" fill="hsl(240.00,100.00%,50.00%)" /> <rect x="0" y="64" width="32" height="32" fill="hsl(300.00,100.00%,33.00%)" />
<rect x="32" y="64" width="32" height="32" fill="hsl(240.00,100.00%,97.00%)" /> <rect x="32" y="64" width="32" height="32" fill="hsl(300.00,100.00%,37.00%)" />
<rect x="64" y="64" width="32" height="32" fill="hsl(240.00,100.00%,100.00%)" /> <rect x="64" y="64" width="32" height="32" fill="hsl(300.00,100.00%,23.00%)" />
<rect x="96" y="64" width="32" height="32" fill="hsl(240.00,100.00%,93.00%)" /> <rect x="96" y="64" width="32" height="32" fill="hsl(300.00,100.00%,23.00%)" />
<rect x="128" y="64" width="32" height="32" fill="hsl(240.00,100.00%,93.00%)" /> <rect x="128" y="64" width="32" height="32" fill="hsl(300.00,100.00%,37.00%)" />
<rect x="160" y="64" width="32" height="32" fill="hsl(240.00,100.00%,60.00%)" /> <rect x="160" y="64" width="32" height="32" fill="hsl(300.00,100.00%,47.00%)" />
<rect x="192" y="64" width="32" height="32" fill="hsl(240.00,100.00%,77.00%)" /> <rect x="192" y="64" width="32" height="32" fill="hsl(300.00,100.00%,3.00%)" />
<rect x="224" y="64" width="32" height="32" fill="hsl(240.00,100.00%,90.00%)" /> <rect x="224" y="64" width="32" height="32" fill="hsl(300.00,100.00%,50.00%)" />
<rect x="0" y="96" width="32" height="32" fill="hsl(240.00,100.00%,90.00%)" /> <rect x="0" y="96" width="32" height="32" fill="hsl(300.00,100.00%,20.00%)" />
<rect x="32" y="96" width="32" height="32" fill="hsl(240.00,100.00%,100.00%)" /> <rect x="32" y="96" width="32" height="32" fill="hsl(300.00,100.00%,10.00%)" />
<rect x="64" y="96" width="32" height="32" fill="hsl(240.00,100.00%,80.00%)" /> <rect x="64" y="96" width="32" height="32" fill="hsl(300.00,100.00%,13.00%)" />
<rect x="96" y="96" width="32" height="32" fill="hsl(240.00,100.00%,73.00%)" /> <rect x="96" y="96" width="32" height="32" fill="hsl(300.00,100.00%,7.00%)" />
<rect x="128" y="96" width="32" height="32" fill="hsl(240.00,100.00%,100.00%)" /> <rect x="128" y="96" width="32" height="32" fill="hsl(300.00,100.00%,0.00%)" />
<rect x="160" y="96" width="32" height="32" fill="hsl(240.00,100.00%,63.00%)" /> <rect x="160" y="96" width="32" height="32" fill="hsl(300.00,100.00%,23.00%)" />
<rect x="192" y="96" width="32" height="32" fill="hsl(240.00,100.00%,67.00%)" /> <rect x="192" y="96" width="32" height="32" fill="hsl(300.00,100.00%,43.00%)" />
<rect x="224" y="96" width="32" height="32" fill="hsl(240.00,100.00%,80.00%)" /> <rect x="224" y="96" width="32" height="32" fill="hsl(300.00,100.00%,43.00%)" />
<rect x="0" y="128" width="32" height="32" fill="hsl(240.00,100.00%,60.00%)" /> <rect x="0" y="128" width="32" height="32" fill="hsl(300.00,100.00%,20.00%)" />
<rect x="32" y="128" width="32" height="32" fill="hsl(240.00,100.00%,87.00%)" /> <rect x="32" y="128" width="32" height="32" fill="hsl(300.00,100.00%,33.00%)" />
<rect x="64" y="128" width="32" height="32" fill="hsl(240.00,100.00%,53.00%)" /> <rect x="64" y="128" width="32" height="32" fill="hsl(300.00,100.00%,20.00%)" />
<rect x="96" y="128" width="32" height="32" fill="hsl(240.00,100.00%,60.00%)" /> <rect x="96" y="128" width="32" height="32" fill="hsl(300.00,100.00%,47.00%)" />
<rect x="128" y="128" width="32" height="32" fill="hsl(240.00,100.00%,87.00%)" /> <rect x="128" y="128" width="32" height="32" fill="hsl(300.00,100.00%,27.00%)" />
<rect x="160" y="128" width="32" height="32" fill="hsl(240.00,100.00%,93.00%)" /> <rect x="160" y="128" width="32" height="32" fill="hsl(300.00,100.00%,50.00%)" />
<rect x="192" y="128" width="32" height="32" fill="hsl(240.00,100.00%,80.00%)" /> <rect x="192" y="128" width="32" height="32" fill="hsl(300.00,100.00%,40.00%)" />
<rect x="224" y="128" width="32" height="32" fill="hsl(240.00,100.00%,77.00%)" /> <rect x="224" y="128" width="32" height="32" fill="hsl(300.00,100.00%,30.00%)" />
</svg> </svg>

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

8
tools/gencommit.sh Executable file
View File

@@ -0,0 +1,8 @@
#!/bin/bash
set -eo pipefail
here="$(dirname "$(realpath "$0")")"
cd "$here/.."
echo "Generating examples/commithash.svg"
python3 -m colorhash "$(git rev-parse HEAD)" --input-type hash --hash sha1 --output-type svg --out examples/commithash.svg

View File

@@ -22,5 +22,4 @@ while read infile; do
done done
# Additionally, create an SVG for the current commit hash # Additionally, create an SVG for the current commit hash
echo "Generating examples/commithash.svg" tools/gencommit.sh
python3 -m colorhash "$(git rev-parse HEAD)" --input-type hash --hash sha1 --output-type svg --out examples/commithash.svg