TW core is pretty seriously synchronous, I believe. But the existence of tm-http-request
makes it clear that there are ways to deal with asynchronous functions as well. I will dig into that soon, but I imagine it is reasonably complex. I’m wondering if there are simple examples of wikitext (if possible) or JS code (more likely) that are async.
My use case is pretty simple. I’m generating SVG images in TW, which was surprisingly easy. But my final format has to be PNG or PDF. I have a simple function that generates PNGs from the SVG strings, but it uses new Image()...onLoad
, which now makes it asynchronous. I haven’t tried using it yet, but it’s not clear to me how to use it to, say, render a tiddler with that PNG output. So are there good examples of similar things in the community?