logseq-publish-excalidraw-t.../to_svg.sh

8 lines
383 B
Bash
Raw Normal View History

2023-10-13 21:12:11 +00:00
#!/usr/bin/env bash
2023-10-15 21:53:33 +00:00
echo ::debug::'$1:' "$1"
echo ::debug::'$2:' "$2"
2023-10-15 15:46:00 +00:00
EXCALIDRAW=$(jq '{"type": .type, "version": .version, "source": .source, "elements": .elements, "appState": {"gridSize": null, "exportWithDarkMode": '"$2"'}}' "$1")
2023-10-15 21:53:33 +00:00
echo ::debug::'$EXCALIDRAW' "$EXCALIDRAW"
2023-10-13 21:12:11 +00:00
curl localhost:8080/excalidraw/svg --data-raw "$EXCALIDRAW" > "$1.svg"
2023-10-15 21:57:06 +00:00
echo ::debug::"svg: $(cat $1.svg)"