-
-
Notifications
You must be signed in to change notification settings - Fork 38
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
Support Wikilink syntax #10
Comments
Seeing as this is an existing extension to Markdown, I think wiki syntax-style links is within the scope of this plugin, so I hope to implement this at some point. I'll post here when I have this ready for testing @daniel-vera-g. |
@daniel-vera-g I just pushed this to the dev branch if you'd like to test it. If you're using packer, you can do a use({
'jakewvincent/mkdnflow.nvim',
branch = 'dev',
config = function()
require('mkdnflow').setup({
-- ...
link_style = 'wiki',
-- ...
})
end
}) |
I've been testing out the wiki style links, no issues so far. Thanks for adding it. It'd be nice if there was syntax to highlight the wiki links. I went back to using treesitter for markdown to give the wiki links some highlighting, but I'd ditch it again if it had some without it. No worries if you don't intend to add syntax for it, just a thought. |
That's good news @gregdezeeuw, thanks for trying it out! I don't currently have plans to add syntax highlighting, but I'll consider it. Does highlighting without treesitter otherwise seem acceptable? |
Aside from wiki links, there isn't any highlighting I'm lacking. Well, I would appreciate some highlighting for the ToDo status symbols, but that is super minor. Thanks again for the plugin. |
Aha, after adding the to-do status commands was when I first had the urge to add some special highlighting for to-do statuses, but I haven't looked into it yet. I'll comment here if I end up adding it. Glad you find the plug-in useful! |
Sorry to reopen this, would it be possible to have a wikilink syntax without the additional name part ( |
Hi @jmbuhr, the syntax without the name actually does already work (as in the links are followed), but do you mean that you'd like to have an option where links created from the word under the cursor and such are created without the additional name part of the link? |
Yes, this is what I had in mind. It wouldn't be a good default option because it breaks the reversibility of "plain text" -> "link" for links whose name has more than one word and capitalization, but it would be a very helpful option. Would you be open to a PR if I added this as an option? Example link behaviour in logseq, which has two folders,
|
I see... interesting! I'm definitely open to a PR if you wanted to try to implement this. I like the idea of a user-defined function for processing links. A similar idea would be to allow the user to arbitrarily specify rules of interpretation, where if some pattern is matched in a link, a certain string modification is made (implicitly) before the link is interpreted. I sort of like the former for its flexibility. I'm imagining that the local format_date = function(string)
-- Change date string to formatted date
end
require('mkdnflow').setup({
links = {
interpret = function(input)
if input:match('%u%a+ %d+%a%a, %d%d%d%d') then
return('journals/'..format_date(input))
else
return('pages/'..input)
end
end
}
}) |
Sounds great, thanks for the implementation hints already! |
Hey, @jakewvincent thanks for adding the Feature. Currently I'm having some issues installing the Plugin using: {
"jakewvincent/mkdnflow.nvim",
branch = "dev",
config = function()
require("mkdnflow").setup({
links = {
style = "wiki",
},
})
end,
}, and getting:
Using the Plugin regularly on Main I get I'm using:
Any Ideas what the reason could be? |
Hi @daniel-vera-g, I was able to reproduce this on my end and found an issue in the setup function. It should be fixed now in both main and dev. Can you run |
Thanks for the fast reply! Creating anchor/web links is not that relevant for me with Wikilinks, but
Nevertheless, would just be a nice to have and currently not really necessary for me. |
@daniel-vera-g ah, thanks for reporting that! There was an error in one of my regex patterns. Fixed :) |
It seems like |
@jmbuhr oh, thanks! I'll fix this in a moment. I didn't update the reference to the old config.link_style in the dev branch. |
I also just pushed the fix to the PR :D |
Awesome, thanks! Fixed for dev in commit 1a926cc |
I was using treesitter to highlight wikilinks, but got tired of the slowdown in large files bug. I made a super simple autocmd (for lua) that seems to work. Here it is for anybody that wants their wikilinks highlighted.
|
I was planning to use this Plugin as lightweight Vimwiki (Actually wiki.vim) alternative because I actually only used the file/link navigation.
Nevertheless, I saw that Wiklinks(
[[wikilink]]
) are not supported or I did not find the configuration. As I mainly use Obsidian and telekasten support for this would be great.I could think of this as a config like in wiki.vim.
The text was updated successfully, but these errors were encountered: