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

(Feature request) Wikify a note #788

Open
diyoyo opened this issue Dec 15, 2024 · 6 comments
Open

(Feature request) Wikify a note #788

diyoyo opened this issue Dec 15, 2024 · 6 comments

Comments

@diyoyo
Copy link
Member

diyoyo commented Dec 15, 2024

Describe feature

Similar to "search and replace", I'm thinking of a tool that could wikify a given note, ie transform a plain text into a note that connects other notes together everytime the keyword appears.
Currently, I do it manually, using "Ctrl+L" to trigger the popup menu and link a part of a sentence to a given trilium note.
But what if we could automate the search and link, at least for exact matches ?

Before
image

After
image

Additional Information

Implementation thought:

  • I guess it would go in the sandwich menu on the top right
  • it would require taking into account duplicate titles when matching words
  • an extra feature, just like "Search and Replace", would be to go "one by one", to confirm the linking more granularly
@CobriMediaJulien
Copy link
Contributor

Did i understand this right that you want to automatically add a link from every "Wikipedia" in your notes to your Wikipedianote?

@meichthys
Copy link
Contributor

meichthys commented Dec 16, 2024

No, my understanding was that it would only link to other notes in the Trilium instance. Sounds like a neat idea to me.

@Nriver
Copy link
Member

Nriver commented Dec 16, 2024

Interesting idea.

@pano9000
Copy link
Contributor

the "automatic" linking would only work for words/phrases, that are an exact match of title of another note, correct?

e.g. let's say you have a note with the title
Test Note ABC

and you then create a new note, with a content like

This is a note, but the best note is Test Note ABC

you would want the text part Test Note ABC to be linked with the Note, that has the same title, right?

@diyoyo
Copy link
Member Author

diyoyo commented Dec 16, 2024

No, my understanding was that it would only link to other notes in the Trilium instance. Sounds like a neat idea to me.

That's correct, this is what I meant. @CobriMediaJulien , Sorry for the confusion.

the "automatic" linking would only work for words/phrases, that are an exact match of title of another note, correct?

e.g. let's say you have a note with the title Test Note ABC

and you then create a new note, with a content like

This is a note, but the best note is Test Note ABC

you would want the text part Test Note ABC to be linked with the Note, that has the same title, right?

That's correct. As far as I pushed the reasoning yesterday, the non-obvious links will still have to be done manually.

however... I realize I'm already doing a trick, even for manual linking, since the Meta+L already suggests that the note is to be searched based on the selected text:
So far, my trick is to have a label #alias that is hidden in the attributes, so that the search still returns the correct result (at least in the top list).

Example:
note title : John Doe
attribute : #label:alias="Dad"

Maybe the automated linking could try to match the aliases too. Maybe only in a supervised ("Do you confirm (y/n)") way though, since it would be tricky to avoid duplicate issues.

I'm starting to implement aliases for translations as well, since I have days when I write in english and days when I write in french, but I still want to refer to the same note.

@Nriver
Copy link
Member

Nriver commented Dec 19, 2024

I’ve implemented this feature using trilium-py.

Before:

After:

You can find more details in the documentation:
Advanced Usage - Automatically Add Internal Links.

Please note that I haven’t tested it extensively across all my notes. There’s a possibility of errors, which could potentially disrupt your notes. To stay safe, make sure to back up your notes before proceeding.

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

5 participants