Closed DhruvaSambrani closed 1 month ago
tldraw currently requires a browser context in order or create images. We could have an endpoint for this, ie send us the tldr file and we’ll send back an image that we’ve created, though thats probably not what you’d be after.
It might be worth spiking to see how much of the shape toSvg content could be extracted from the shape utils into its own library.
In case it's helpful to others who find this issue, I've implemented an unofficial tldraw command line tool that uses Puppeteer to export tldraw sketches to SVG and other formats.
It's not super fast, but it works: https://github.com/kitschpatrol/tldraw-cli
Also wrote a Vite plugin on top of this to allow .tldr
module imports: https://github.com/kitschpatrol/vite-plugin-tldraw
The example above using Puppeteer is a reasonable solution for this for folks that need this kind of functionality. We don't plan on officially supporting a CLI at the moment but the tooling above does lend itself to be malleable (and let you do things like using it with Puppeteer). Thanks @kitschpatrol for the example :)
What's the feature?
I would like to export a tldr file as an svg/png using the command line. I need this as an intermediate step before embed those files into a document.
I intend to write a pandoc filter which looks for markdown images with the image url as
filename.tldr#pagename.type
and usespagename.type
after exporting the pages offilename.tldr
. Thus you can use hand-drawn images from tldraw in documents with the images being up to date. This can also be used with quarto.Contact Details
No response
Code of Conduct