Is there a way to automatically export a schematic (and layout) to SVG either on save or on a Git commit?
I need this in almost every project, to automatically generate up-to-date documentation readable straight from the browser, i.e. without going through KiCad.
For V5 you can go with plotkicadsch. It can generate a svg of a schematics or a svg of a diff of schematics. I think that is your only option for your workflow (without KiCad).
There was also a user which had a headless Kicad setup, which would automatically run and perform a couple of actions (plot being one of them) when a new commit was detected on a repo. But this was server side thing. Can’t find a link though.
Yes python API for eeschema is planned for v6. So there is no “proper” way to do this right now but if you are brave enough you can do what this person did: https://www.youtube.com/watch?v=NZCyk3rmmGQ
That looks quite nice, although I can’t install it due to some incompatibility between OCaml and gcc 10. So I have to wait a bit.
Looking forward to that! It would be extremely handy to always have an up-to-date schema and layout to share on the web. Currently I’m using KiCad to document the wiring at Dim Sum Labs hacker space in Hong Kong.
As fast as the layout is concerned, you might find this project helpful - it can be used to generate layout diffs. A CLI has very recently been added which might help you to automate the process.
Thanks for the suggestion! It looks like a heavy weight solution, though, especially for my setup: I run KiCad on Windows, and I git commit from a Linux running in a virtual machine. For now I am just exporting manually to SVG from Eeschema. I hope that in the future I can hook a Python script to save.
Don’t forget you can use GiTHub/GitLab CI/CD actions to do the job.
It means you can use their servers to run the job, wait a few minutes and download the results. You don’t need to run it in locally.
I’ll see. Thanks for the suggestions! So far I continue exporting manually, waiting for a light weight native solution in the future. But maybe I’m just old fashioned.