Skip to content

Commit

Permalink
chore(docs): auto generate docs
Browse files Browse the repository at this point in the history
  • Loading branch information
epwalsh authored and github-actions[bot] committed Mar 13, 2024
1 parent 9049199 commit 53eace3
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions doc/obsidian.txt
Original file line number Diff line number Diff line change
Expand Up @@ -554,17 +554,8 @@ carefully and customize it to your needs:
---@param path obsidian.Path the absolute path to the image file
---@return string
img_text_func = function(client, path)
local link_path
local vault_relative_path = client:vault_relative_path(path)
if vault_relative_path ~= nil then
-- Use relative path if the image is saved in the vault dir.
link_path = vault_relative_path
else
-- Otherwise use the absolute path.
link_path = tostring(path)
end
local display_name = vim.fs.basename(link_path)
return string.format("![%s](%s)", display_name, link_path)
path = client:vault_relative_path(path) or path
return string.format("![%s](%s)", path.name, path)
end,
},
}
Expand Down

0 comments on commit 53eace3

Please sign in to comment.