alphapapa / org-sidebar

A helpful sidebar for Org mode
GNU General Public License v3.0
527 stars 16 forks source link

Support headline backlinks #55

Open memeplex opened 2 years ago

memeplex commented 2 years ago

Hi, I like some of the trendy ZK ideas but I'm not 100% sold. For example I don't think it's worth losing many features org mode offers for single file (or at least not thousands of files) setups. Also I dislike metadata overhead and I believe that with some care linking to headlines is just fine, I don't want to have property drawers everywhere, wikis has been linking to filenames for decades, moreover having backlinks at sight makes it easy to rename them in case it's necessary.

I was glad to learn that this project implements a backlink facility without requiring or promoting a many-files workflow, but it was a bummer to find out that it still requires id links. I don't know how difficult it's to add headline backlinks to the sidebar, but it would be nice to support different workflows.

alphapapa commented 2 years ago

Hi, yes, this would be good to do. Off the top of my head, I don't recall the specific reasons why I didn't already do this; it might relate to difficulties or ambiguities in how headline links are expressed in Org syntax. But it's probably possible to do it to some extent, even if it would have limitations.

I probably won't work on this feature anytime soon, so patches welcome, as well as pre-code design/testing that could save time coding. :)

alphapapa commented 6 months ago

Revisiting this a couple of years later, from what I've learned, sometimes the hard way, I've found that ID links are much more reliable and consistent. Links based on heading text are very prone to breaking, as well as suffering from various incompatibilities across Org versions as link-related regexps and functions change. Even now I still sometimes find a case where a heading link fails due to the heading itself containing a link, etc.

And, of course, a user is free to rename a heading, correct spelling mistakes, etc, if ID links are used; but if the heading text itself is used, any changes to it means broken links.

So while I wouldn't necessarily oppose code that supports heading-based backlinks, I would strongly recommend that users use ID-based ones.

memeplex commented 5 months ago

I've found that ID links are much more reliable and consistent

I agree, it's just that the trade-off is not that good for a pure-text approach in which most things are directly exposed, specially when you are also bombarded with a convoluted filename (timestamp, slug, sometimes other encoded metadata), an outline heading and often a document title also. This has always kept me away from org-roam.

Anyway the issue is mainly about backlinks to headlines, not headline (as opposed to id) based backlinks. This is in order to avoid the tons-of-small-files paradigm that also keeps me away from org-roam (after all, it's the cause of many of the aforementioned metadata). Wrt ids, I find the approach of vanilla org quite sane.