Replies: 2 comments
-
Interesting. I'm fine with adding this, but maybe it's already there. How familiar are you with the |
Beta Was this translation helpful? Give feedback.
0 replies
-
I've had a look at both classes, but in general I'm more familiar with Then we could write something along the lines of (defun write-image (path &key allow-outside-channel)
(unless slynk::*channel* (error "You must use this method in a channel"))
(with-open-file (in path :direction :input :element-type '(unsigned-byte 8))
(let* ((arr (make-array (file-length in) :element-type '(unsigned-byte 8)))
(b64 (progn (read-sequence arr in)
(cl-base64:usb8-array-to-base64-string arr))))
(send-to-remote-channel
slynk:*channel*
`(:write-image ((:data ,b64 :type (file-type path))) path))))) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I was thinking about implementing inline media support for Slyblime. The client side support will be fairly easy (at least for Sublime Text) but based on this proof of concept for SLIME I assume a Emacs contrib wouldn't be that difficult either. The main difficulty with the approach there is that the Common Lisp code needs a way to figure out which channel it is outputting to, so that it can send the
write-media
command, so I was wondering if that were possible as I've not been able to figure that out while reading the code.(An alternative approach, used by Geiser, is just to print
#<Image: ...>
and then perform a replacement, but that approach seems messier than the concept above)Beta Was this translation helpful? Give feedback.
All reactions