On Tue, May 17, 2022 at 10:00 PM Paco
Hi all,
One question about draw.io: is there a tool we could use in the build process of our documentation to render the .drawio files to SVG, so we don't have to check in the SVG files?
drawio supports being called on the command-line like this:
drawio in.drawio --export --output out.png # or svg
Yes, and no. Yes, command line but no in a headless environment. It was easy to test this before "jekyll build" with "drawio in.drawio --export --output test.svg" However, [vilvo@blop:~/dev/spectrum/Documentation]$ nix-build -I nixpkgs=../../nixpkgs-spectrum ... error: builder for '/nix/store/r8xf2kpba673ngi2fck4xsyvyc6pd3j1-spectrum-docs.drv' failed with exit code 133; last 10 log lines: > at new ElectronStore (/nix/store/iqinmbk2jzl8nay42hqkbd32mbj1jzq7-drawio-18.0.6/share/drawio/resources/app.asar/node_modules/electron-store/index.js:48:32) > at Object.<anonymous> (/nix/store/iqinmbk2jzl8nay42hqkbd32mbj1jzq7-drawio-18.0.6/share/drawio/resources/app.asar/electron.js:15:15) > at Module._compile (node:internal/modules/cjs/loader:1116:14) > at Object.Module._extensions..js (node:internal/modules/cjs/loader:1169:10) > at Module.load (node:internal/modules/cjs/loader:988:32) > at Module._load (node:internal/modules/cjs/loader:829:12) > at Function.c._load (node:electron/js2c/asar_bundle:5:13343) > at Object.<anonymous> (node:electron/js2c/browser_init:185:3104) > at Object../lib/browser/init.ts (node:electron/js2c/browser_init:185:3308) > /build/.attr-0l2nkwhif96f51f4amnlf414lhl4rv9vh8iffyp431v6s28gsr90: line 1: 5 Trace/breakpoint trap (core dumped) drawio in.drawio --export --output test.svg Issue is the same with drawio versions: - version 15.7.3 from nixpkgs - version 17.4.2 from nixpkgs-spectrum - latest rpm available - 18.0.6 from updated nixpkgs-spectrum
but it's a huge dependency, as it's an Electron app, installing it requires ~400 MB…
This could be managed with caching but that's not the issue. People seem to have worked around the issue in CI with solutions like https://hub.docker.com/r/tomkludy/drawio-renderer I did not test it yet but would this be ok for a CI pipeline? Best, -Ville