(feat): support file-level IDs (#1163)

Additionally cache IDs at outline-level 0, now that property drawers are supported in Org 9.4.

Update org-roam--format-link to prefer ID links wherever possible. That is, when a file has an ID, use an id link instead of file link.
This commit is contained in:
Jethro Kuan
2020-10-05 16:57:54 +08:00
committed by GitHub
parent 6759bee56b
commit d973e8f6e0
7 changed files with 89 additions and 95 deletions

View File

@ -239,7 +239,7 @@
:to-equal
'("t1" "t2 with space" "t3" "tags"))))))
(describe "Headline extraction"
(describe "ID extraction"
(before-all
(test-org-roam--init))
@ -252,12 +252,12 @@
(buf (find-file-noselect fname)))
(with-current-buffer buf
(funcall fn fname)))))
(it "extracts headlines"
(expect (test #'org-roam--extract-headlines
(it "extracts ids"
(expect (test #'org-roam--extract-ids
"headlines/headline.org")
:to-have-same-items-as
`(["e84d0630-efad-4017-9059-5ef917908823" ,(test-org-roam--abs-path "headlines/headline.org")]
["801b58eb-97e2-435f-a33e-ff59a2f0c213" ,(test-org-roam--abs-path "headlines/headline.org")])))))
`(["e84d0630-efad-4017-9059-5ef917908823" ,(test-org-roam--abs-path "headlines/headline.org") 1]
["801b58eb-97e2-435f-a33e-ff59a2f0c213" ,(test-org-roam--abs-path "headlines/headline.org") 1])))))
(describe "Test roam links"
(it ""