Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vimwiki links to documents marked as non-existent #122

Open
McKean opened this issue Dec 12, 2022 · 5 comments
Open

vimwiki links to documents marked as non-existent #122

McKean opened this issue Dec 12, 2022 · 5 comments

Comments

@McKean
Copy link

McKean commented Dec 12, 2022

Not sure if there is an issue on my side so I'll just explain what I'm observing.

Link to non-existent document with the title 'snippets'
image

image

I have the .marksman.toml file present in the root.

Is this expected? When I use "traditional" markdown syntax for links then I don't get any issues no matter if the file exists or not.

Thanks!

@McKean
Copy link
Author

McKean commented Dec 12, 2022

Okay I got a bit closer but there still is an issue.

If I add # snippets to the snippets.md file the error disappears. Hooray!

However when I use a named link eg. [[snippets|my snippets]] the title expected is # snippets|my snippets which doesn't seem desirable.

Any thoughts?

@artempyanykh
Copy link
Owner

artempyanykh commented Dec 13, 2022

Thanks for raising this @McKean!

  1. Regarding the link destination: currently, wiki-links use document's title slug (# first level heading) as the destination. However, there's work to make it configurable and allow file-name links too (the motivation is to allow neuron/obsidian/emanote style links). feat: Configurable link format #117 is pretty close to completion.
  2. Titles in wiki links [[<dest>|<title>]] are not supported yet. Mainly, because no-one asked before :) If wiki-link titles are a part of your workflow, please do open an issue to support wiki-link titles.

Hope this helps!


UPD: both of the features have been implemented since.

@tangledhelix
Copy link

I encountered the same issue, but will mention another wrinkle. If I use "traditional" Markdown links as mentioned above, by which I mean something like:

[snippets](snippets)

Then marksman is happy. If I use the shortcut version:

[snippets][]

Then, even if the file "snippets.md" exists, I get an LSP warning "Link to non-existent link definition with the label 'snippets'".

If I use the wikipedia-style [[snippets]] it is fine, but that's not what vimwiki does when I press "enter" in Markdown mode, so it's a little clunkiy, although it works and isn't that cumbersome.

@artempyanykh
Copy link
Owner

Hi @tangledhelix! Thanks for the extra context. [snippets][] syntax is usually used to point to link definitions inside the document, e.g.

[snippets][]

[snippets]: snippets.org

rather than to other documents. I'm a bit hesitant to overload this syntax even further, given that we already have markdown inline links [snippets]() and wiki-style links [[snippets]].

@tangledhelix
Copy link

@artempyanykh That's perfectly reasonable... I was thinking about this, and I think a more correct move would be for me to encourage use of [[ link ]] style in the vimwiki project. There's an issue open for that already (vimwiki/vimwiki#892).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants