AutoYADM commit: 2024-12-03 18:15:03
This commit is contained in:
parent
bb33d90531
commit
2cc615e218
1 changed files with 11 additions and 8 deletions
|
@ -10,6 +10,7 @@
|
||||||
-- })
|
-- })
|
||||||
local function resolver(document_path, image_path, fallback)
|
local function resolver(document_path, image_path, fallback)
|
||||||
local working_dir = vim.fn.getcwd()
|
local working_dir = vim.fn.getcwd()
|
||||||
|
Snacks.notify.notify("Resolving... " .. working_dir)
|
||||||
-- Format path for Obsidian vault
|
-- Format path for Obsidian vault
|
||||||
if working_dir:find("/home/fic/second-brain", 1, true) then
|
if working_dir:find("/home/fic/second-brain", 1, true) then
|
||||||
-- if working_dir:find("~/second-brain/") then
|
-- if working_dir:find("~/second-brain/") then
|
||||||
|
@ -35,15 +36,17 @@ return {
|
||||||
integrations = {
|
integrations = {
|
||||||
markdown = {
|
markdown = {
|
||||||
enabled = true,
|
enabled = true,
|
||||||
|
resolve_image_path = resolver,
|
||||||
-- From https://github.com/3rd/image.nvim/issues/190
|
-- From https://github.com/3rd/image.nvim/issues/190
|
||||||
resolve_image_path = function(document_path, image_path, fallback)
|
-- resolve_image_path = function(document_path, image_path, fallback)
|
||||||
-- document_path is the path to the file that contains the image
|
-- Snacks.notify.notify("This prints")
|
||||||
-- image_path is the potentially relative path to the image. for
|
-- -- document_path is the path to the file that contains the image
|
||||||
-- markdown it's ``
|
-- -- image_path is the potentially relative path to the image. for
|
||||||
|
-- -- markdown it's ``
|
||||||
-- you can call the fallback function to get the default behavior
|
--
|
||||||
return fallback(document_path, image_path)
|
-- -- you can call the fallback function to get the default behavior
|
||||||
end,
|
-- return fallback(document_path, image_path)
|
||||||
|
-- end,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue