HTTP server directly in binary
Currently, the playground repo contains a small Go app which responds to /render/* requests. That app could be inlined into the actual D2 binary.
Doing so would allow using the app in a "daemon mode", for example building a bunch of diagrams from a static site generator (SSG) by having the binary run in Docker and just build SVGs on demand like an utility / appliance.
Think Hugo in dev mode vs Hugo build.
That's a good idea. Like Python's built-in simple http server.
There's a lot to do before this though so if someone with Go experience wants to give it a try, PRs welcome!
@alixander when you say
There's a lot to do before this
I'm assuming you don't mean "blockers", you mean "other stuff with higher priority", right?
Sorry yes. No blockers for this. Should be relatively straightforward to base off of https://github.com/terrastruct/d2/blob/master/d2cli/watch.go#L483C27-L483C45 . Definitely don't want any new dependencies (e.g. a web framework).