GitHub's markdown sanitizer strips style, class and inline <svg>, so the
coloured card cannot be inline HTML there. Build the card once as
(text, colour) segments and render it two ways: the existing <pre> with
coloured spans for Gitea, and a committed SVG behind <picture> for GitHub
(dark + light variants follow prefers-color-scheme).
--svg DIR writes terminal-{dark,light}.svg; --terminal-image swaps the
block for the <picture>. The Gitea workflow is unchanged.
This commit is contained in:
1 parent
0bd015c9a8
commit
ec787dc131
2 files changed
+180
-37
No files matched your search
@@ -49,8 +49,12 @@ jobs:
|
||||
KOMODO_API_SECRET: ${{ secrets.KOMODO_API_SECRET }}
|
||||
VIKUNJA_TOKEN: ${{ secrets.VIKUNJA_TOKEN }}
|
||||
run: |
|
||||
python3 /tmp/src/tools/gen_readme.py --write
|
||||
# GitHub's sanitizer strips style/class/inline <svg>, so the coloured
|
||||
# terminal card ships as a committed SVG behind <picture> instead of
|
||||
# the inline <pre> Gitea gets.
|
||||
python3 /tmp/src/tools/gen_readme.py --write --svg /tmp/svg --terminal-image
|
||||
cp /tmp/src/README.md README.md
|
||||
cp /tmp/svg/terminal-dark.svg /tmp/svg/terminal-light.svg .
|
||||
|
||||
- name: Check links are public
|
||||
run: python3 /tmp/src/tools/gen_readme.py --check-links
|
||||
@@ -59,7 +63,7 @@ jobs:
|
||||
run: |
|
||||
git config user.name trex
|
||||
git config user.email nanobot@jonb.io
|
||||
git add README.md
|
||||
git add README.md terminal-dark.svg terminal-light.svg
|
||||
if git diff --cached --quiet; then
|
||||
echo "no change"
|
||||
exit 0
|
||||
|
||||
Reference in new issue
Block a user