svg.py
Online playground for svg.py, the best Python library for generating SVG files.
Try it online: svg.orsinium.dev.
Use cases:
- Try the library without installing it.
- Fine-tune your art without switching back-and-forth between IDE and browser.
Powered by pyodide managed from WASM-compiled Go application using GWeb. All the code is ran on the client-side (in the browser).
Running locally
You'll need task and go. When you do, simply run task run
and go to localhost:1337.
Basic autocomplete
CodeMirror doesn't support autocompletion for Python out of the box, and I'm not smart enough to write a partial parser for Python on JS. I've hacked around a simple autocomplete for words. The only thing that sucks is that after
svg.
it autocompletes everything, including all builtins.Gosh. If anything feels like diving into autocompletion mechanisms for CodeMirror and writing an autocomplete for Python, that would be great. See https://github.com/codemirror/codemirror5/issues/6348
optimize wasm with binaryen
It makes deployment a minute slower but shaves off about 200 kB from the wasm binary. I also tried tinygo, but something doesn't work well with
go:embed
.