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

Validate/fix all backlinks #93

Open
meedstrom opened this issue Apr 8, 2024 · 4 comments
Open

Validate/fix all backlinks #93

meedstrom opened this issue Apr 8, 2024 · 4 comments

Comments

@meedstrom
Copy link

Hi, I didn't get this info from the readme, but is it possible to scan all files in a directory to fix outdated backlinks?

I mainly use org-roam, but it's slow with thousands of nodes. Thinking about rewriting its org-roam-db-update-file, I understood that a major performance challenge is figuring out which subtree to which a backlink belongs, so it's a great idea to "cache" backlinks as org-super-links does!

I'm just concerned about the info staying up to date. Or what if you inherit an org-roam directory, already full of ID-links, but you never used org-super-links so none of them have a :BACKLINKS: property?

@toshism
Copy link
Owner

toshism commented May 14, 2024

If you use org-id for links, which is strongly recommended, then you shouldn't need to worry about them getting out of sync. If something changes though org-id does provide org-id-update-id-locations. So basically org-super-links does not manage any of it itself and leaves it to standard org-mode/emacs machinery.

There is no current way to bulk add backlinks properties automatically either. There is the org-super-links-convert-link-to-super function that will get you part of the way there by handling a single link, but nothing in bulk at the moment.

Hopefully that answers your questions.

@meedstrom
Copy link
Author

I understand, and indeed bulk-adding is one of my two concerns. The other is, what happens when you remove a link? I assume the backlink must be removed manually by the user?

In the time since I filed this issue, I made the following package, which does try to offer org-super-links integration: https://github.com/meedstrom/org-node?tab=readme-ov-file#backlink-solution-2-printed-inside-the-file

I could try to reuse my experience with my in-house :BACKLINKS: property, and come up with a similar bulk-adder for org-super-links drawers if you want. But I am not sure about the best way to automate cleanup, since it seems org-super-links offers a lot of customization, with timestamped backlinks etc.

@meedstrom
Copy link
Author

Ah, I see there exists a command org-super-links-delete-link! Never mind my second concern.

@toshism
Copy link
Owner

toshism commented May 29, 2024

A bulk adder would be great. It's something I've always wanted to work on but just haven't made the time.

You may also find this interesting https://github.com/toshism/org-super-links/wiki/Tips#create-a-new-target-and-auto-link-to-it if you like the org-roam style capture stuff. It's not exactly the same but could easily be adapted to function similarly. You just need to create a capture template that creates a new file or whatever.

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

2 participants