fix journelly import

This commit is contained in:
Willem van den Ende
2025-10-11 16:01:13 +01:00
parent 41ac6ca98c
commit 7493f54ec8
+6 -9
View File
@@ -40,15 +40,9 @@ Opens the capture buffer for review before finalizing."
(content (journelly-entry-content parsed)) (content (journelly-entry-content parsed))
(heading (journelly-entry-heading parsed)) (heading (journelly-entry-heading parsed))
(url (journelly-entry-url parsed))) (url (journelly-entry-url parsed)))
;; Build the initial content ;; Build the initial content without ID (org-roam will add it)
(let ((initial-content (let ((initial-content
(concat (concat
":PROPERTIES:\n"
":ID: " (org-id-new) "\n"
(when url (concat ":ROAM_REFS: " url "\n"))
(when heading (concat ":JOURNELLY_HEADING: " heading "\n"))
":END:\n"
"#+title: " title "\n\n"
(or content "") "\n"))) (or content "") "\n")))
(org-roam-capture- (org-roam-capture-
:node (org-roam-node-create :title title) :node (org-roam-node-create :title title)
@@ -56,9 +50,12 @@ Opens the capture buffer for review before finalizing."
:jump-to-captured t) :jump-to-captured t)
:templates `(("d" "default" plain :templates `(("d" "default" plain
,initial-content ,initial-content
:target (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "") :target (file+head "%<%Y%m%d%H%M%S>-${slug}.org"
,(concat "#+title: ${title}\n"
(when url (concat "#+roam_refs: " url "\n"))
(when heading (concat "#+journelly_heading: " heading "\n"))
"\n"))
:unnarrowed t)))))) :unnarrowed t))))))
(ert-deftest test-journelly-parse-basic () (ert-deftest test-journelly-parse-basic ()
(let* ((entry " * [2025-10-08 Wed 22:39] @ - (let* ((entry " * [2025-10-08 Wed 22:39] @ -
Paul is #XP Paul is #XP