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

Link to Note Block #1021

Closed
meichthys opened this issue May 15, 2020 · 15 comments
Closed

Link to Note Block #1021

meichthys opened this issue May 15, 2020 · 15 comments

Comments

@meichthys
Copy link
Collaborator

I was a long time user of Onenote but finally made the migration to Trilium and have absolutely no regrets - Thanks @zadam for an impressive piece of software!

The only feature that i find myself missing quite often from OneNote is the option to link to a specific internal paragraph. I've learned to work around this for now, but I think it would be a welcome feature. Even if it wasn't possible via the Ctrl-L menu, it would be nice to be able to "Copy Trilium link to paragraph" or something similar to provide some more fine-grained internal linking.

@DimitriyPro
Copy link

Yes, it will be really nice feature

@kard32
Copy link

kard32 commented Jun 4, 2020

So Obsidian just did this - linking to headers. Might be something good to draw inspiration from!

@zadam
Copy link
Owner

zadam commented Jun 4, 2020

To give here some response - while this is a valid feature request, it's quite a bit more complex than one could guess from outside. So don't get your hopes up, it's probably not coming in near or medium term future.

@meichthys
Copy link
Collaborator Author

@zadam Thanks for your response, and keep up the great work!
Please feel free to close this issue.

@zadam
Copy link
Owner

zadam commented Oct 9, 2022

One thing which I've been concerned about is the paragraph link "stability" - paragraphs are added/removed, renamed, copy pasted etc. and it's not easy to make sense of the persistent identity of the paragraph.

One promising solution I noticed in some editors is making anchors an explicit object. Unfortunately, CKEditor 5 does not support this feature, although there is a considerable interest. I think once this is added, we should be able to add support for linking such anchors into Trilium.

@gettalong
Copy link

@zadam As you already mentioned, I don't know the insides of the editor, only the outside which I use.

It is already possible in Trilium to change the type of "paragraph", e.g. to header or list item or such, using the icon in front of the paragraph.

Would it be possible to auto-generate an anchor tag with a unique ID on paragraph creation? E.g. when I type "Enter" in the editor, a new line opens up and the editor automatically generates the anchor tag. Then it doesn't matter what the type of the paragraph is as long as the anchor tag stays with it (that might be not so easy to implement). However, this would probably allow adding, removing, renaming, etc. to work as expected.

@jat255
Copy link

jat255 commented Jan 4, 2023

Could it be possible to dynamically resolve the link, rather than waiting on some sort of feature from CKEditor for this?

A (perhaps not perfect, but good) idea could be to limit links to headers. A link would be created from existing headers, and then when the link is followed, the front-end could dynamically evaluate the current headers into a slug and see if any of them match the link provided. If none match, a pop-up notice could be shown to the user that the link is out of date and suggest they fix it (and then just leave the view at top of the note, as normally done).

I think this is similar to how a lot of web tools work for markdown headers. Anchors are automatically created from headers in a slug style (i.e. "This is a header" would become an anchor #this-is-a-header).

Just my $0.02

@meichthys
Copy link
Collaborator Author

Seems reasonable. What about duplicate heading matches? Would we just link to the first one in the document?

@jat255
Copy link

jat255 commented Jan 4, 2023

Hmm, maybe append the slug with -2, -3, etc.? I think that's how I've seen it done on the web in the past (I agree this isn't a perfect solution, but it may be better than nothing)

@zadam
Copy link
Owner

zadam commented Jan 4, 2023

The problem with the auto-generated anchors is that they are extremely fragile - a simple rewording/typo will break the link. IMHO a much better solution is to explicitly create an anchor which will be stable, but that needs some CKEditor support.

@realysy
Copy link

realysy commented Feb 26, 2023

How about do something first, then try to improve it when there is another progress.....The internal links generated by the function "copy link to this paragraph" in Onenote sometimes will become dead, but it is still a good way to make connections between notes.

Is it possible and good to use creating-time to identify paragraph in CKEditor or Trilium? Then use note-id and paragraph-creating-time to generate internal links?

@HilkopterBob
Copy link

@zadam ?

@meichthys meichthys changed the title Link to Paragraph Feature Link to Note Block Dec 9, 2023
@nymation
Copy link

Fwiw, I think if an idea in a note is worth linking to, it seems worth extracting to its own note, and then just linking the note. Similar principles for modularity apply for note-taking as it does for programming.

@HilkopterBob
Copy link

@nymation
That would fundamentally undermine the ability to create wiki-style entries inside trilium, as it would suggest ripping apart Wiki-pages into their own notes.

As trilium supports publishing of whole document trees I currently use it as a form of wiki for work where I publish public articles as a form of technical wiki so I see the use case for a paragraph Link feature.

@meichthys
Copy link
Collaborator Author

Trilium has entered maintenance mode. Future enhancements will be addressed in TrilumNext: TriliumNext/Notes#108

@meichthys meichthys closed this as not planned Won't fix, can't repro, duplicate, stale May 9, 2024
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

9 participants