-
Notifications
You must be signed in to change notification settings - Fork 12
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 for following anchor links #9
Comments
Hey! Thanks for your interest and kinds words! Yeah, internal links of all sorts are currently missing and definitely something that would make sense for the plugin. I can only support features that are supported by the treesitter parser, so I'll have to check regarding the pandoc specific stuff. I'm also a bit busy at the moment, so I'm not sure when I'll get around to taking a stab at this. Do any of the more feature-rich plugins you mention support what you want? Might lessen the necessary work a bit if we can take some inspirations from them... :) |
Excellent point! I did a bit of digging and here is what I found within each that may help on this issue in particular and potentially with internal linking in general. I can't find anything concrete among the other plugins for bracketed span support (mainly That said, there is Vimwiki supports anchor links (see "vimwiki-anchors" heading) for headers as usual as well as for tags and bold text. I'm not sure whether this only applies to Vimwiki's custom filetype or if it extends to Markdown as well, but it may be worth combing through the Vimscript to find how they handle linking to bold text or tags as there may be some function that can be generalized to link to any arbitrary delimiters instead of just bold text or tags as they have implemented. Finally, |
Thanks a lot for doing all the research! I'm gonna have a look at this in the next days! :) |
Sorry for taking so long to get back to you! I've had a look at the info you provided, and it looks like none of them use treesitter to implement link detection. It's still nothing major to implement this here, but right now I'm prioritising another project of mine. I'd of course be very happy about any PRs! |
If feasible, I think enabling anchored links to work like non-anchored ones (discarding the anchor part for now) would be a good intermediate step. |
No worries, @jghauser! We all get busy from time to time and this is something you're contributing on your own time (I presume), so any assistance at your convenience is appreciated. I have been quite busy as well and unfortunately can't help with a PR at the moment myself as I know almost nothing about Lua or how to work with Treesitter, but it's something I'll start delving into in coming months if it's not already addressed by then In the meantime, in case anyone wants a Lua-native solution that doesn't (to my knowledge) use Treesitter, |
First off: thanks for the great plugin! Glad to have this functionality independent of other Markdown plugins laden with more features than what I need.
The only thing(s?*) I think I'm missing from this plugin is support for following Markdown anchor links as outlined here.
Concrete case: I created a journal file (
2022-07-11.md
) that outlined what I was learning in Lua one day and another file for notes on Lua (lua.md
) within the same directory. Withinlua.md
, there is a section header by the name "Tables," which should be addressable through the aforementioned anchor link schema aslua.md#tables
. However, the plugin no longer follows the link tolua.md
at all, let alone place the cursor at the specified header.* I'm unsure if this is a separate feature or just an extension of the plain anchor link schema above, but Pandoc-flavored Markdown allows for addressing arbitrary chunks of text through the use of tagged spans. This extension would literally fulfill all my needs if it were possible to address those tagged span anchors as well.
P.S. I'd be happy to contribute how I can, which for now would probably just be testing until I learn enough Lua.
e: this documentation about header links in Markdown may also be of some use, I think
The text was updated successfully, but these errors were encountered: