[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/denote-refs 36fbf22f85 3/9: Support Markdown notes
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/denote-refs 36fbf22f85 3/9: Support Markdown notes |
Date: |
Mon, 19 Dec 2022 14:59:00 -0500 (EST) |
branch: elpa/denote-refs
commit 36fbf22f85a5d130ba147e950711348b1bf4e280
Author: Akib Azmain Turja <akib@disroot.org>
Commit: Akib Azmain Turja <akib@disroot.org>
Support Markdown notes
* denote-refs.el (denote-refs--render): Support
'markdown-mode'.
---
denote-refs.el | 31 ++++++++++++++++++++++++++++++-
1 file changed, 30 insertions(+), 1 deletion(-)
diff --git a/denote-refs.el b/denote-refs.el
index dc58ac0cd6..a71fe2eda4 100644
--- a/denote-refs.el
+++ b/denote-refs.el
@@ -112,7 +112,36 @@ the key is the absolute path.")
'action (lambda (_)
(funcall denote-link-button-action
(cdr ref))))
- (insert ?\n)))))))
+ (insert ?\n))))
+ ('markdown-mode
+ ;; Insert references count.
+ (insert (if (eq refs 'not-ready)
+ (format "<!-- ... %s -->\n" (if (eq section 'links)
+ "links"
+ "backlinks"))
+ (format "<!-- %i %s%s\n" (length refs)
+ (if (eq section 'links)
+ "link"
+ "backlink")
+ (pcase (length refs)
+ (0 " -->")
+ (1 ":")
+ (_ "s:")))))
+ ;; Insert reference list.
+ (when (listp refs)
+ (while refs
+ (let ((ref (pop refs)))
+ (insert " ")
+ (insert-button
+ (car ref)
+ 'help-echo (cdr ref)
+ 'face 'denote-faces-link
+ 'action (lambda (_)
+ (funcall denote-link-button-action
+ (cdr ref))))
+ (unless refs
+ (insert " -->"))
+ (insert ?\n))))))))
(defun denote-refs--goto-end-of-front-matter ()
"Go to the end of front matter of the note."
- [nongnu] branch elpa/denote-refs created (now d7908630b3), ELPA Syncer, 2022/12/19
- [nongnu] elpa/denote-refs fd767c5199 5/9: Don't repeat update timer, ELPA Syncer, 2022/12/19
- [nongnu] elpa/denote-refs 478ff07529 8/9: Refactored various things, ELPA Syncer, 2022/12/19
- [nongnu] elpa/denote-refs c41007596e 1/9: Support Org mode notes, ELPA Syncer, 2022/12/19
- [nongnu] elpa/denote-refs 69cdec1c3d 2/9: Support plain text notes, ELPA Syncer, 2022/12/19
- [nongnu] elpa/denote-refs 36fbf22f85 3/9: Support Markdown notes,
ELPA Syncer <=
- [nongnu] elpa/denote-refs 1493b87d35 6/9: Ensure buffer is live before updating with timer, ELPA Syncer, 2022/12/19
- [nongnu] elpa/denote-refs 9bca564284 7/9: Report zero references when file doesn't exist, ELPA Syncer, 2022/12/19
- [nongnu] elpa/denote-refs d7908630b3 9/9: ; * .dir-locals.el: New file, ELPA Syncer, 2022/12/19
- [nongnu] elpa/denote-refs 1de65d20e8 4/9: Don't error when used with 'org-capture', ELPA Syncer, 2022/12/19