-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
clerk/image should have an option to set the size #630
Comments
You might want to override the clerk/src/nextjournal/clerk/viewer.cljc Lines 941 to 951 in 8d2929b
with a (quoted) function that best suits your needs. (clerk/add-viewers! [(assoc viewer/image-viewer :render-fn my-render-fn)]) Alternatively you might nest (ns scratch.debug
(:require [nextjournal.clerk :as clerk]))
(clerk/html [:style "div.container img {
width: 200px;
height: 200px;
object-fit: fit;}"])
(clerk/html [:div.container (clerk/image "trees.png")]) |
@zampino Very nice! I do think it would be nice to have some of these options as part of |
I wanted to embed an image. The source image was large, but I just wanted it to take up 100-200px of vertical space rather than the full screen.
I couldn't figure out any better way to do it than to manually resize the image locally.
The text was updated successfully, but these errors were encountered: