Replies: 3 comments 4 replies
-
Hey @Demianeen this is not on our roadmap, but if someone can find a clean way to integration it then I'd be happy to accept a PR! |
Beta Was this translation helpful? Give feedback.
-
The solution I have for this is to have all of my images in an assets/images folder which is defined both in Obsidian and obsidian.nvim and then in the image.nvim setup have something like this markdown = {
enabled = true,
filetypes = { "markdown" },
resolve_image_path = function(document_path, image_path, fallback)
image_path = "Path/to/vault" .. image_path
return fallback(document_path, image_path)
end,
}, |
Beta Was this translation helpful? Give feedback.
-
The following solution will work whether you open the file directly, such as -- inside 'lua/plugins/image.lua'
local function resolver(document_path, image_path, fallback)
local vault_dir = "/path/to/your/vault"
-- Check if the document is inside the vault
if document_path:find(vault_dir, 1, true) then
-- If so, return formatted path to image
return vault_dir .. "/" .. image_path
end
-- fallback to default since not in vault
return fallback(document_path, image_path)
end
return {
{
"3rd/image.nvim",
opts = {
integrations = {
markdown = {
resolve_image_path = resolver,
},
},
},
},
} |
Beta Was this translation helpful? Give feedback.
-
I recently found this awesome plugin! But I found myself unable to view the images in it. The solution that I found was a image.nvim plugin, but from what I see obsidian ignores all path to the image and just uses image name. Is it possible to somehow integrate them?(or any other plugin with such functionality)
Beta Was this translation helpful? Give feedback.
All reactions