-
Notifications
You must be signed in to change notification settings - Fork 136
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
LSP autocompletion for heading IDs #224
Comments
It's not high on my personal list as my notes are pretty small, but this should certainly be possible with It requires a few things:
Number 1 is not so easy. HTML anchors ( If someone wants to help kickstart this feature without diving in the code, it would be helpful to find and list the various implementations used to generate heading anchors. |
Regarding anchor ID... Why not just create a hash (sha256 or 512) of it? This way you don't need to worry about all these weird edge cases, the id will be standardized and consistent, and won't have to worry about formatting. |
It is definitely just a "nice to have" feature and not the deal breaker for me personally. |
@eric-hansen Inside An alternative could be to insert an HTML anchor manually when linking to a section, but this would look a bit ugly in the notes IMHO. |
Here are some good starting points for research: |
Maybe inserting a manual anchor is not so bad. Yes it's ugly, but it's guaranteed to work everywhere and it's also stable if you change the heading title or reorder the sections (assuming index-based generated IDs). # My heading
<a id="e3f"/>
Content with [link](#e3f) However this poses some challenging with LCP, I'm not sure we can modify the target document during completion. |
I'm also in favor of manual anchor because it is Personally, I really like Obsidian's block ID despite its incompatibility, because it looks clean in plain text and enables fine-grained references. related: srid/emanote#105 |
Discussed in zk-org/zk-nvim#53
Originally posted by @dzintars June 3, 2022
Hi all. REALLY impressive tooling! :)
I have a question about Heading ID autocompletion?
Is it possible?
I know that if many nested levels i a single note breaks the "atomicity rule", but still..
There is an image of what i mean. That Tmux note contains few sections, i would like to link to.
This is how it looks in Obsidian:
I believe
block
references are Obsidian specific only so i don't care much about them.But Heading IDs would be helpful to have after typing
#
. Currently it returns list of tags.The text was updated successfully, but these errors were encountered: