nobiot/md-roam

(feat) Support markdown [title](filename.md#header) in backlinks?

LER0ever opened this issue · 4 comments

Currently, traditional markdown links can be detected for [title](filename.md), but not for [title](filename.md#header). It would be great if the latter is also considered when generating the backlinks database.

For example:

<!--a.md-->

# A

[Link to B that works](b.md)
<!--b.md-->

# B
[Link to A that does NOT work](a.md#A)

Thanks for your suggestion. I will need to think this one through.

Org-roam is planned to have a breaking change to V2, where only ID links will be supported, both files and headlines.

Given this, Md-roam will need to adapt. I think that file ID support can be added as an additional property in the YAML frontmatter.

Heading ID? I don't know yet.

At this stage, I don't use links to headings (although I think it makes sense). I am more inclined to supporting a future-proof , V2 compliant way of linking heading ID than supporting the standard markdown syntax (file.md#heading).

What do you think?

At this stage, I don't use links to headings (although I think it makes sense). I am more inclined to supporting a future-proof , V2 compliant way of linking heading ID than supporting the standard markdown syntax (file.md#heading).

How about handling the (filename.md#heading) just like (filename.md)? For me personally, knowing that file A is backlinked by file B is enough, and I only need file-level information in the graph view. This I believe can be trivially implemented by throwing away the heading information after #.

Org-roam is planned to have a breaking change to V2, where only ID links will be supported, both files and headlines.

I did not have much org-mode files in my kb, so I'm not following the updates on the org-roam side. But as someone who rarely use markdown frontmatters and heading identifiers, I suppose that will in some degree break backlinks? (unless of course md-roam can generate those IDs upon link creation or db refresh).

How about handling the (filename.md#heading) just like (filename.md)? For me personally, knowing that file A is backlinked by file B is enough, and I only need file-level information in the graph view. This I believe can be trivially implemented by throwing away the heading information after #.

Oh I see. Thank you. Let me try this. I am not 100% sure if I will have enough time in March (I'm in the thick of pressing deadlines for other parts of life in March), but I am hoping to have more time in April / May.

Org-roam V2 will be a major breaking change, and yes, it will break backlinks not based on IDs (when implemented in Md-roam). I think I will cut a version, and "freeze" the version of Md-roam compatible with Org-roam V1.

I will then make the main branch of Md-roam follow the V2 main branch of Org-roam.

The V2 branch is already visible in Org-roam repo, so the change is coming very soon (but not sure exactly when).

I think 9330c58 has fixes the problem. Let me know if it still persists.