add svgs to assets/autogen

This commit is contained in:
Lu Baumann 2023-10-17 02:07:38 +00:00 committed by GitHub
parent d3f573b4af
commit 9518372418
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -17,7 +17,7 @@ runs:
run: find "${{ github.workspace }}" -type f -name '*.excalidraw' -exec bash "${{ github.action_path }}/to_svg.sh" "{}" ${{ inputs.dark-mode == 'true' }} ";"
shell: bash
- name: Replace excalidraw file references
run: find "${{ github.workspace }}" -type f -name '*.md' -exec sed -ri 's|\[\[(.*\.excalidraw)\]\]|![\1](\1.svg)|g' "{}" ";"
run: find "${{ github.workspace }}" -type f -name '*.md' -exec sed -ri 's|\[\[(.*\.excalidraw)\]\]|![\1](assets/autogen/\1.svg)|g' "{}" ";"
shell: bash
- name: Stop containers
run: docker-compose -f "${{ github.action_path }}/docker-compose.yml" down

View File

@ -3,4 +3,5 @@ EXCALIDRAW="$(jq '{"type": .type, "version": .version, "source": .source, "eleme
ENCODED="$(echo $EXCALIDRAW | python -c "import sys; import base64; import zlib; print(base64.urlsafe_b64encode(zlib.compress(sys.stdin.read().encode('utf-8'), 9)).decode('ascii'))")"
echo ::debug::'$ENCODED' "$ENCODED"
docker ps
curl "localhost:8080/excalidraw/svg/$ENCODED" > "$1.svg"
mkdir -p "assets/autogen/$(dirname $1)"
curl "localhost:8080/excalidraw/svg/$ENCODED" > "assets/autogen/$1.svg"