I’d like to use today’s daily note as the target for org-protocol captures.
Ideally when I would run the capture it would behave like org-roam-dailies-capture-today but insert the org-protocol contents into a new heading.
Thank you.
I’d like to use today’s daily note as the target for org-protocol captures.
Ideally when I would run the capture it would behave like org-roam-dailies-capture-today but insert the org-protocol contents into a new heading.
Thank you.
your question is not very clear. Do you want org-roam-protocol capture to redirect to your daily note? that would be trivial to just change the file+head or otherwise target and make the file argument follow from the daily template
can you clarify the problem better
Yes, I want that.
Can you please show me how? I tried to make the capture template for it but didn’t manage.
I’ll get back to you in a few days. Even if there is not a simple solution - I’ll try to carve out and hijack the protocol to do our bidding. Im also interested in sending captures to a file because I don’t find refs for them useful to use. But this could break url-refs. We will see.
Thank you!
(setopt org-roam-dailies-capture-templates
'(("n" "day-page" entry
"* %?"
:target (file+head "%<%Y-%m-%d>.org"
"#+title: %<%d-%m-%Y>\n")
:empty-lines 1
:Unnarrowed t)))
;; template
(setopt org-roam-capture-ref-templates
'(("w" "webcapture" entry
"* [[${ref}][${title}]]\n\n${body}\n%?"
:target (file+head "journal/%<%Y-%m-%d>.org"
"#+title: %<%d-%m-%Y>\n")
:empty-lines 1
:unnarrowed t)))
I posted a more complex solution previously - on checking it seems the problem is more simple - we can simply convert a daily capture template to this. It is quite simple.
More example
(add-to-list 'org-roam-dailies-capture-templates
'("d" "day-entry" entry
"* %<%d-%m-%Y> \n\n%?"
:target (file+datetree "%<%Y>.org" month)
:empty-lines 1
:unnarrowed t
:jump-to-captured t))
;; template
(setopt org-roam-capture-ref-templates
'(("w" "webcapture" entry
"* [[${ref}][${title}]]\n\n${body}\n\n%?"
:target (file+datetree "journal/%<%Y>.org"
month)
:empty-lines 1
:unnarrowed t
:jump-to-captured t)))
What I use
(with-eval-after-load 'org-roam-protocol
(add-to-list 'org-roam-capture-ref-templates
'("w" "webcapture" entry
"* ${title}
[[${ref}][>link]]
#+creation: %<%d-%m>\n
${body}\n
%?"
:target (file+datetree "journal/%<%Y>.org"
month)
:empty-lines 1
:unnarrowed t
:jump-to-captured t)))
Yes that works very well, thank you!
I had unfortunately assumed the filename and title format chars
wouldn’t get expanded and didn’t even try it.
Thank you for helping!