ivanceras / svgbob

Convert your ascii diagram scribbles into happy little SVG
http://ivanceras.github.io/svgbob-editor/
Apache License 2.0
3.91k stars 112 forks source link

Svg file returned from url #70

Closed billthefarmer closed 3 years ago

billthefarmer commented 3 years ago

What would be useful would be a method of returning a svg image from a request URL containing the source text, similar to SciWeavers site to return an image from Latex text (http://www.sciweavers.org/tex2img.php?eq=\sum_{i=1}^{n}x_{i}^{2}&bc=cornsilk&fc=black&im=jpg&fs=24&ff=arev).

Latex

ivanceras commented 3 years ago

@billthefarmer that would be doable, but I don't have resources to provide such a server. If there is somebody willing to donate a server, I would build it.

billthefarmer commented 3 years ago

You've already got one in your svgbob editor page. You appear to have compiled your rust sources to web assembly and used a JavaScript wrapper to provide the page functionality. the JavaScript appears to include a function to take a text string and return an SVG image by calling web assembly functionality.

If you did what I suggest it might generate more traffic than GitHub are happy with if it became popular.

ivanceras commented 3 years ago

If doing all the execution in client-side with the webassembly code, then the output of the url would be a DOM which is not an svg image. This generated dom can not be simply used in an img src= tag. This would then be embedded in webpages which I think is not a straightforward way to do it. It would be akin to embedding a tweet with all the needed wasm binary and assets rather than generating a rendered image server side.

billthefarmer commented 3 years ago

If you have an account on Sourceforge, you can use Developer Web. I used to have some stuff on there, but moved it to here. It can be horribly slow, but it works, good enough for testing. I noticed for some things hosted on there that get a lot of traffic, like OpenGApps, it works very well.

ivanceras commented 3 years ago

You can go ahead and do it yourself. This project is opensource, the build script and everything is in here.