org-roam-server icon indicating copy to clipboard operation
org-roam-server copied to clipboard

Nodes and headline links

Open fkgruber opened this issue 4 years ago • 8 comments

Hi org-roam now supports headline links. This is particularly useful when we have whole books that we are reading with org-noter and want to point to specific sections. However, currently org-roam-server just points to the file. It seems that it would be more useful if it creates a new node to that headline. And maybe automatically add a link between that headline node and the file node

thanks FKG

fkgruber avatar Jul 17 '20 18:07 fkgruber

As far as I know the headlines are stored as unique ids with their corresponding files. So I think It is not possible to add them as meaningful nodes without parsing the corresponding files.

    (headlines
     [(id :unique :primary-key)
      (file :not-null)])

goktug97 avatar Jul 26 '20 10:07 goktug97

Do you have any updates?

goktug97 avatar Aug 06 '20 11:08 goktug97

I think it's very handy functionality. So is it quite hard to parse files?

theotheo avatar Aug 07 '20 12:08 theotheo

It will cause drop in performance and the function runs every second. I think parsing every file that has headlines might cause performance issues. People already experiencing performance issues and because of that I added org-roam-server-network-poll variable.

Also having nodes which are named "Introduction" will clutter the graph. It can be grouped into one node but grouped nodes don't support some of the functions that are used.

goktug97 avatar Aug 07 '20 12:08 goktug97

What if we use cache parsed files? Is it would help to keep performance at an acceptable level?

theotheo avatar Aug 07 '20 15:08 theotheo

I don't know, it feels a little bit hacky. Also there are still cluttering problem and lack of functionality in clusters. If someone wants to try to implement this, can send a PR.

goktug97 avatar Aug 09 '20 10:08 goktug97

BTW, I think to implement clusters or something! Is there any recommendations? Maybe we should open the separate issue to discuss clustering?

theotheo avatar Aug 09 '20 11:08 theotheo

https://visjs.github.io/vis-network/docs/network/#methodClustering

It will probably require lots of changes in the current code.

Maybe headline title can be added directly to the org-roam. As far as I understood from the db entries there no title for headlines but there might be a way to get them without actually parsing the file if it is already present somewhere else. @jethrokuan Is there a way to get the headline string from the db without parsing the file?

goktug97 avatar Aug 09 '20 11:08 goktug97