mirror of
https://github.com/org-roam/org-roam
synced 2025-09-16 15:56:48 -05:00
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:
19
org-roam.el
19
org-roam.el
@@ -22,11 +22,6 @@
|
|||||||
:type 'directory
|
:type 'directory
|
||||||
:group 'org-roam)
|
:group 'org-roam)
|
||||||
|
|
||||||
(defcustom org-roam-zettel-indicator "§"
|
|
||||||
"Indicator in front of a zettel."
|
|
||||||
:type 'string
|
|
||||||
:group 'org-roam)
|
|
||||||
|
|
||||||
(defcustom org-roam-position 'right
|
(defcustom org-roam-position 'right
|
||||||
"Position of `org-roam' buffer.
|
"Position of `org-roam' buffer.
|
||||||
|
|
||||||
@@ -47,6 +42,16 @@ Valid values are
|
|||||||
(const title))
|
(const title))
|
||||||
:group 'org-roam)
|
: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."
|
(defcustom org-roam-buffer-width 0.33 "Width of `org-roam' buffer."
|
||||||
:type 'number
|
:type 'number
|
||||||
:group 'org-roam)
|
: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))
|
(make-empty-file file-path))
|
||||||
(insert (format "[[%s][%s]]"
|
(insert (format "[[%s][%s]]"
|
||||||
(concat "file:" file-path)
|
(concat "file:" file-path)
|
||||||
title)))))
|
(format org-roam-link-title-format title))))))
|
||||||
|
|
||||||
(defun org-roam--insert-id ()
|
(defun org-roam--insert-id ()
|
||||||
"Find `ID', and insert a relative org link to it at point."
|
"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))
|
(make-empty-file file-path))
|
||||||
(insert (format "[[%s][%s]]"
|
(insert (format "[[%s][%s]]"
|
||||||
(concat "file:" file-path)
|
(concat "file:" file-path)
|
||||||
(concat org-roam-zettel-indicator id)))))
|
(format org-roam-link-id-format id)))))
|
||||||
|
|
||||||
;;; Finding org-roam files
|
;;; Finding org-roam files
|
||||||
(defun org-roam-find-file ()
|
(defun org-roam-find-file ()
|
||||||
|
Reference in New Issue
Block a user