Add org-roam capture templates
This commit is contained in:
@@ -402,15 +402,38 @@ Setup =org-roam=.
|
|||||||
;; Exclude Syncthing backup directory
|
;; Exclude Syncthing backup directory
|
||||||
(setq org-roam-file-exclude-regexp "\\.stversions")
|
(setq org-roam-file-exclude-regexp "\\.stversions")
|
||||||
(setq org-roam-title-to-slug-function #'dot/org-roam-title-to-slug)
|
(setq org-roam-title-to-slug-function #'dot/org-roam-title-to-slug)
|
||||||
(setq org-roam-verbose nil))
|
(setq org-roam-verbose nil)
|
||||||
|
|
||||||
|
;; Templates used when creating a new file
|
||||||
|
(setq org-roam-capture-templates
|
||||||
|
'(("d" "default" plain #'org-roam-capture--get-point
|
||||||
|
"%?"
|
||||||
|
:file-name "%<%Y%m%d%H%M%S>-${slug}" :head "#+TITLE: ${title}\n#+ROAM_TAGS: %^{Roam tags}\n" :unnarrowed t))))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
Enable [[https://www.orgroam.com/manual/Roam-Protocol.html#Roam-Protocol][Roam-Protocol]], needed to process =org-protocol://= links
|
Enable [[https://www.orgroam.com/manual.html#Roam-Protocol][Roam Protocol]], needed to process =org-protocol://= links
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(use-package org-roam-protocol
|
(use-package org-roam-protocol
|
||||||
:ensure nil ; org-roam-protocol.el is part of org-roam
|
:ensure nil ; org-roam-protocol.el is part of org-roam
|
||||||
:after org-roam)
|
:after org-roam
|
||||||
|
:config
|
||||||
|
|
||||||
|
;; Templates used when creating a new file from a bookmark
|
||||||
|
(setq org-roam-capture-ref-templates
|
||||||
|
'(("r" "ref" plain #'org-roam-capture--get-point
|
||||||
|
"%?"
|
||||||
|
:file-name "${slug}" :head "#+TITLE: ${title}\n#+ROAM_KEY: ${ref}\n\n${body}" :unnarrowed t))))
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
The roam-ref protocol bookmarks to add:
|
||||||
|
|
||||||
|
#+BEGIN_SRC javascript :tangle no
|
||||||
|
javascript:location.href =
|
||||||
|
'org-protocol://roam-ref?template=r'
|
||||||
|
+ '&ref=' + encodeURIComponent(location.href)
|
||||||
|
+ '&title=' + encodeURIComponent(document.title)
|
||||||
|
+ '&body=' + encodeURIComponent(window.getSelection())
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
Setup =org-roam-server=.
|
Setup =org-roam-server=.
|
||||||
|
|||||||
Reference in New Issue
Block a user