How to omit relative file path from blink autocomplition and link creation? #504
avucic
started this conversation in
Show and tell
Replies: 1 comment
-
{
---@param opts { path: string, label: string, id: string|integer|?, anchor: obsidian.note.HeaderAnchor|?, block: obsidian.note.Block|? }
---@return string
markdown_link_func = function(opts)
local util = require("obsidian.util")
local anchor = ""
local header = ""
if opts.anchor then
anchor = opts.anchor.anchor
header = util.format_anchor_label(opts.anchor)
elseif opts.block then
anchor = "#" .. opts.block.id
header = "#" .. opts.block.id
end
local path = util.urlencode(vim.fs.basename(opts.path), { keep_path_sep = true })
return string.format("[%s%s](%s%s)", opts.label, header, path, anchor)
end,
}Nice issue to keep track of. In obsidian app, there's three link formats:
It seems a bit weird now that markdown follows 2 and wiki links follows 1. That is just historical issue, I will properly support all three and make it configurable in a new |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
hi,
I have
preferred_link_style = "markdown"I have notes in my folder 01_Notes
When I type and try to link note blink will create link including folder name
[File](01_Notes/file.md)How to omit folder name?
Beta Was this translation helpful? Give feedback.
All reactions