How to render figures in Pluto markdown?

Hi

How to render local figures in Pluto.jl markdown?
I’ve tried

md"""
![fig1](fig1.png)
"""

in pluto notebook cells where fig1.png is under the same directory as the notebook. However, the figure was note rendered at all.

Any help would be much appreciated!

1 Like

One way is to use LocalResource from PlutoUI.jl.

Another, maybe more transferable, is to manually encode your image into base64 and embed it as

$(Resource(
    "data:image/png;base64,#=base64-encoded file here=#",
    MIME("image/png"),
    (:height => 240)
))
3 Likes