Revamped the jm/dt-format-link function
This commit is contained in:
parent
76a28920c7
commit
67fa5435ab
@ -34,14 +34,9 @@ These functions are for my org roam daily capture template.
|
|||||||
|
|
||||||
(defun jm/dt-format-link (prefix)
|
(defun jm/dt-format-link (prefix)
|
||||||
(let ((item-name (org-entry-get nil "ITEM"))
|
(let ((item-name (org-entry-get nil "ITEM"))
|
||||||
(item-id (org-entry-get nil "ID"))
|
(item-id (org-id-get-create))
|
||||||
(doc-id (car (org-property-values "ID")))
|
|
||||||
(doc-title (org-get-title)))
|
(doc-title (org-get-title)))
|
||||||
(cond ((stringp item-id)
|
(format "%s [[id:%s][%s - %s]]" prefix item-id doc-title item-name)))
|
||||||
(format "%s [[id:%s][%s]]" prefix item-id item-name))
|
|
||||||
((and (stringp doc-id) (stringp doc-title))
|
|
||||||
(format "%s [[id:%s][%s - %s]]" prefix doc-id doc-title item-name))
|
|
||||||
(nil (error "jm/dt-format-link: couldn't find a valid id")))))
|
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** Queries
|
** Queries
|
||||||
|
Loading…
x
Reference in New Issue
Block a user