Rendering local images with dataviewjs #902
Rubecks
started this conversation in
Show and tell
Replies: 1 comment 6 replies
-
Well this just saved me a lot of stress. Thanks |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi. I just wanted to share a simple way I found to make dataviewjs render local images on both apps, desktop and mobile.
The
filePath()
function just checks if the string starts with http, and converts it to an internal link otherwise, using the vault.getResourcePath function.A minor inconvenience is that getResourcePath needs the full path to the images. So
attachments/example.png
works, but justexample.png
,![](attachments/example.png)
or![[example.png]]
doesn't. But It can easily be upgraded with more checks to parse wiki links, markdown formatted links, etc.Beta Was this translation helpful? Give feedback.
All reactions