-
Notifications
You must be signed in to change notification settings - Fork 1
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
changed to Roam-style backlinking #3
base: master
Are you sure you want to change the base?
Conversation
made the forward-link scanner look not only at top-level links, but recursively inside, including subpages and really any page that can be reached from the original collected. This is much closer to how Roam Research works. IMPORTANT NOTE: the new code will go outside of just the target collection. thus, this script is more risky than the original version! (But more powerful.)
now we make an actual link in the backlinks section. (note that the formatting of this is not as nice as that of an @-mention. would be nicer to have that formatting, but I don't know how to produce it)
the program now refreshes all backlinks, and adds them as url-links. it refreshes the backlinks by going to the backlinks section of each page, and removing all backlinks that point to pages that we have scanned. It then adds the backlinks, as url-links, and adds some context.
Move to Roam-style backlinks
put in special treatment of backlinks to pages whose title includes an http address.
fixed a couple small bugs
I'm on vacations, plese gimme a few days to look at it. |
@twkrol I actually have a new version with a bunch of fixes and improvement. Will try to push and open a PR in the next few days. Merging can definitely wait at least till then :) |
- more link types are now recognized - the context of the forward-link is now kept and included alongside the backlink - only the original workspace is processed - better dealing with notion API timeouts -
@twkrol update: I added all the features I want to add. The program logic became quite complex. It runs well on my workspace. It might crash and require extra error handling for edge-cases that can't be found on my workspace: In any case, it became quite strong, and is adding many backlinks that it didn't before. This script serves all my needs, and I'm not planning to do more work on it. It's now a decent replacement for Roam so I believe it's worth merging. |
I made many changes:
I made the script consider all links in the page, not only those that are in the specialized "Reflinks" section. This is much closer to how Roam Research works.
I made the forward-link scanner look not only at the specified collection, but recursively inside, including inside subpages, and really inside any page that can be reached from the specified collection. IMPORTANT NOTE: the new code will go outside of just the specified collection -- into any page that is reachable from the original collection (and potentially into all pages that can be edited by the user). thus, this script is more risky than the original version! (But more powerful.)
I changed the added banklinks to be URL-links, rather than page-links. This is useful, since each page-link can only appear once on any given page, so a page-link couldn't appear both in the main page and in the backlinks section. But now, with URL-links, a page can be linked more than once. I would have loved to make the links @mention links to pages (like the ones you get when you press @ in notion and create a link) but I don't know how to generate these in the API
I added context to backlinks: the banklink now gives the contents of the block where the forward-link was found.
Overall, this script achieves functionality that is reminiscent of Roam Research.
This also satisfies feature request #1