Add org-roam-link-id-format and org-roam-link-title-format
This allows for customizing how org-roam links look when inserted
This commit is contained in:
parent
59ebbda730
commit
06890773ae
1 changed files with 12 additions and 7 deletions
19
org-roam.el
19
org-roam.el
|
@ -22,11 +22,6 @@
|
|||
:type 'directory
|
||||
:group 'org-roam)
|
||||
|
||||
(defcustom org-roam-zettel-indicator "§"
|
||||
"Indicator in front of a zettel."
|
||||
:type 'string
|
||||
:group 'org-roam)
|
||||
|
||||
(defcustom org-roam-position 'right
|
||||
"Position of `org-roam' buffer.
|
||||
|
||||
|
@ -47,6 +42,16 @@ Valid values are
|
|||
(const title))
|
||||
:group 'org-roam)
|
||||
|
||||
(defcustom org-roam-link-id-format "§%s"
|
||||
"The format string used when inserting org-roam links that use id."
|
||||
:type 'string
|
||||
:group 'org-roam)
|
||||
|
||||
(defcustom org-roam-link-title-format "%s"
|
||||
"The format string used when inserting org-roam links that use their title."
|
||||
:type 'string
|
||||
:group 'org-roam)
|
||||
|
||||
(defcustom org-roam-buffer-width 0.33 "Width of `org-roam' buffer."
|
||||
:type 'number
|
||||
:group 'org-roam)
|
||||
|
@ -179,7 +184,7 @@ If `ABSOLUTE', return the absolute file-path. Else, return the relative file-pat
|
|||
(make-empty-file file-path))
|
||||
(insert (format "[[%s][%s]]"
|
||||
(concat "file:" file-path)
|
||||
title)))))
|
||||
(format org-roam-link-title-format title))))))
|
||||
|
||||
(defun org-roam--insert-id ()
|
||||
"Find `ID', and insert a relative org link to it at point."
|
||||
|
@ -189,7 +194,7 @@ If `ABSOLUTE', return the absolute file-path. Else, return the relative file-pat
|
|||
(make-empty-file file-path))
|
||||
(insert (format "[[%s][%s]]"
|
||||
(concat "file:" file-path)
|
||||
(concat org-roam-zettel-indicator id)))))
|
||||
(format org-roam-link-id-format id)))))
|
||||
|
||||
;;; Finding org-roam files
|
||||
(defun org-roam-find-file ()
|
||||
|
|
Loading…
Reference in a new issue