Embed pictures with pict?
#140
Closed
opened 8 years ago by jonsterling
·
3 comments
Loading…
Reference in New Issue
There is no content yet.
Delete Branch '%!s(<nil>)'
Deleting a branch is permanent. It CANNOT be undone. Continue?
I have seen that it is possible in Scribble to embed pictures generated with
pict
just by writing code like this in a document:I tried to do the same in a pollen page as follows:
But I received a contract violation:
Is there a proper way to do what I wanted?
Scribble is converting the
pict
object to apng
, saving it, and generating a link to the new file. So you could make a macro that does the same housekeeping. (Edit: I take it back, you can do it with a function not a macro):test.html.pm
pollen.rkt
@mbutterick Thank you very much for the help! Another thing I have tried out (which worked) is encoding the image as base-64 and inlining it into the html. Your solution is probably better for caching purposes.
Sure. The main idea is that whatever comes back from your Pollen function has to be something that counts as a
txexpr-element?
Though it seems to be immovable folk wisdom at this point, I would not necessarily assume that the base64 approach is slower.