From 4ab738a03a2ba9baa412f1a32e87869a1695cda6 Mon Sep 17 00:00:00 2001 From: Michael Wolf Date: Sun, 24 Jul 2022 18:33:20 -0500 Subject: [PATCH 1/3] Implement zetteldeft-insert-link-md-style ref #135 --- zetteldeft.org | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/zetteldeft.org b/zetteldeft.org index 8233741..4454d63 100644 --- a/zetteldeft.org +++ b/zetteldeft.org @@ -815,6 +815,17 @@ When no title is provided, the link itself is used as a descriptor. (insert "[[zdlink:" id "]]"))) #+end_src +Finally, when using Markdown style links, =zetteldeft-insert-link-md-style= +can be used. It inserts a + +#+begin_src emacs-lisp +(defun zetteldeft-insert-link-md-style (id &optional title) + "Insert a Zetteldeft link in Markdown link format" + (if title + (insert (format "[%s](%s%s)" title zetteldeft-link-indicator id)) + (insert (format "[%s%s](%s%s)" zetteldeft-link-indicator id zetteldeft-link-indicator id)))) +#+end_src + *** Finding & linking files from minibuffer **** =zetteldeft-find-file= opens file from minibuffer From d101aee215e0e9c45b10001140fdadc36bd9e6c8 Mon Sep 17 00:00:00 2001 From: Michael Wolf Date: Sun, 24 Jul 2022 18:40:37 -0500 Subject: [PATCH 2/3] Add zetteldeft-insert-link-md-style to custom var ref #135 --- zetteldeft.org | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/zetteldeft.org b/zetteldeft.org index 4454d63..4a7e2f6 100644 --- a/zetteldeft.org +++ b/zetteldeft.org @@ -778,13 +778,15 @@ Note that for the best results, link descriptions should include a =zetteldeft-l #'zetteldeft-insert-link-zd-style "The function to use when inserting note links. -Use either +Use one of - `zetteldeft-insert-link-zd-style' for Zetteldeft type links - `zetteldeft-insert-link-org-style' for Org-mode zdlink: links + - `zetteldeft-insert-link-md-style' for Markdown style links - A custom function that takes two arguments: an ID and an optional title." :type 'function :options '(zetteldeft-insert-link-zd-style - zetteldeft-insert-link-org-style) + zetteldeft-insert-link-org-style + zetteldeft-insert-link-md-style) :group 'zetteldeft) #+end_src From 54abf579c3894e63cfe2a568541dbd5f4a64b14c Mon Sep 17 00:00:00 2001 From: Michael Wolf Date: Sun, 24 Jul 2022 18:41:15 -0500 Subject: [PATCH 3/3] Improve wording now that there are three rather than two options ref #135 --- zetteldeft.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zetteldeft.org b/zetteldeft.org index 4a7e2f6..3937810 100644 --- a/zetteldeft.org +++ b/zetteldeft.org @@ -805,7 +805,7 @@ The default function is =zetteldeft-insert-link-zd-style=, which inserts: (when title (insert " " title))) #+END_SRC -Alternatively, when using Org-mode style links, =zetteldeft-insert-link-org-style= can be used. +When using Org-mode style links, =zetteldeft-insert-link-org-style= can be used. It inserts a formatted Org-link with =zdlink:= type. When no title is provided, the link itself is used as a descriptor.