Closed shrysr closed 1 year ago
It looks like you should add (org-link-set-parameters "id" :store #'org-id-store-link)
.
If you don't want the notebook links, you can also use (org-link-set-parameters "nb" :store nil)
Ah. That worked for the org-id link. However - each time I call org-store-link : I get the question 'which function for creating the link?' and there's only one option there org-id-store-link
. Is there a way for me to not have to select the function each time?
If you delete org-id-store-link you will see two options, the other one for the nb link. I am not sure why there is a preloaded choice. if you set the nb :store link to nil I think that will go away.
Yes, it did go away after setting nb :store link to nil. I have not really used the nb links before - any advantages of using nb links that I should be aware of ? I use nb-new for any new project and org-projectile to capture project specific tasks.
nb links are more portable than id links in some ways. For example, in a git repo if someone makes a heading and links to it by an id, you will not necessarily be able to follow that link if you haven't opened the org-file and had the id registered. This happens a lot to me in shared project files with my students. The nb link avoids that issue and allows you to make a link relative to a project root that works on other machines that also have the project, but maybe in another place (so neither relative nor absolute links would work) as long as you have visited the project with projectile (so that it knows where the root is).
nb links make it easy to make links between projects that don't break when project move around. in principle id links can do this too, but in practice if the id isn't in the id database, it triggers a very long search that the nb link avoids.
nb links have some different actions associated with them also which might be useful, e.g. open bash in the directory with M-b, or finder/explorer with M-e, etc.
I see now what you mean. It appears the nb link references a position? How do you deal with updates in the document?
It can reference a position but if you do that with a character or line number it is fragile and if the document updates the link will not point to the same place anymore. You can also use org references (I think) to headlines. I am thinking of adding some git link capabilities so you can link to past versions of files.
It is possible to link to an image, and see an overlay of the image on the link.
Is there a way to make nb-links compatible with https://github.com/nobiot/org-transclusion?
nb-links only have the information relative to the project root, so one cannot plug into the code that is used for transclusions. For now, I am using org-link-set-parameters "nb" :store nil)
but it would be neat,
I don't know a way to make them compatible. It would probably have to be the other way around, which is figure out how to make org-transclusion work with that kind of link.
OK, just for my understanding, how does emacs resolve a link like nb:esbmtk::esbmtk/esbmtk.py::c1
to the actual location in the filesystem (i.e., ~python/esbmtk/esbmtk.py
) ?
It runs the function nb-follow
. Loosely, that function gets the link path and parses it, then looks through projects defined by projectile to get a root path, and opens the file relative to that, using the location bit at the end for jumping to a character, line, etc.
I saw this function in the docs, but if I run this outside of a project it claims that nb:esbmtk
is not a known project. Yet, if click on the same link, emacs open the correct buffer. Probably todo with context?
The only way you can run it outside a project is like (nb-follow "esbmtk::esbmtk/esbmtk.py::c1")
That should open the file in your project. You don't include nb: in it, that is the link type, and not part of the path.
thanks!
I'm unable to use org-id's for storing links - with scimax loaded and zero user customisation scripts (except the snippet below). Link targets come out to something like
nb:my_org::notes.org::c721452
. Would be grateful for advice on fixing this.Snippet for org id: