yartsu/scripts/theme-showcase-gen

33 lines
636 B
Text
Raw Normal View History

2022-06-14 18:35:47 -05:00
#!/usr/bin/env bash
2023-05-14 18:01:50 -05:00
set -euxo pipefail
2022-06-14 18:35:47 -05:00
THEME_MD="./docs/themes.md"
2023-05-11 07:29:55 -05:00
themes=$(yartsu --list-themes | tail -n +5 | cut -d' ' -f 3)
2022-06-14 18:35:47 -05:00
2023-05-14 13:58:06 -05:00
mkdir -p ./docs/themes
rm -f ./docs/themes/*
2022-06-14 18:35:47 -05:00
rm -f $THEME_MD
2023-05-14 17:56:03 -05:00
yartsu -o docs/themes/list.svg -- yartsu --list-themes
2022-06-14 18:35:47 -05:00
2023-05-14 17:56:03 -05:00
cat >>"$THEME_MD" <<EOF
# Themes
2023-05-14 13:58:06 -05:00
2023-05-14 17:56:03 -05:00
<p align='center'>
<img src="/yartsu/themes/list.svg" width="50%">
</p>
2022-06-15 13:06:30 -05:00
2023-05-14 17:56:03 -05:00
See below for example outputs of each.
EOF
2022-06-15 13:06:30 -05:00
2022-06-14 18:35:47 -05:00
for theme in $themes; do
2023-05-14 13:58:06 -05:00
url="docs/themes/${theme}.svg"
cat >>"$THEME_MD" <<EOF
2023-05-14 17:56:03 -05:00
=== "$theme"
![$theme](./themes/${theme}.svg)
2023-05-14 13:58:06 -05:00
EOF
yartsu --theme "$theme" -o "$url" --demo -t "yartsu --theme ${theme} --demo"
2022-06-14 18:35:47 -05:00
done
echo "finished."