diff options
author | Nicolas Petton | 2021-03-15 00:00:39 +0100 |
---|---|---|
committer | GitHub | 2021-03-15 00:00:39 +0100 |
commit | 78ee615baef3c53c6c3c2f44f2e466c70503ef6f (patch) | |
tree | 7dd75cbb77e900f16a95f2273592b903e2ea6872 /nroam-backlinks.el | |
parent | 7ae549a22225eb1dd099cd63726dc164109c92d7 (diff) | |
parent | f2deda6cd7b0a38966262486e06afeb0a47ef336 (diff) | |
download | nroam-78ee615baef3c53c6c3c2f44f2e466c70503ef6f.tar.gz nroam-78ee615baef3c53c6c3c2f44f2e466c70503ef6f.zip |
Merge pull request #14 from cdlm/single-heading
Organize backlinks under single heading
Diffstat (limited to 'nroam-backlinks.el')
-rw-r--r-- | nroam-backlinks.el | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/nroam-backlinks.el b/nroam-backlinks.el index ff948fe..3d1cb3f 100644 --- a/nroam-backlinks.el +++ b/nroam-backlinks.el @@ -56,19 +56,19 @@ (defun nroam-backlinks--insert-heading (count) "Insert the heading for the backlinks section with a COUNT." - (insert (format "* %s %s :noexport:\n" - (if (= count 0) "No" count) - (nroam--pluralize count "linked reference")))) + (let ((title (format "%s %s" + (if (= count 0) "No" count) + (nroam--pluralize count "linked reference")))) + (nroam--insert-heading 2 title))) (defun nroam-backlinks--insert-group (group) "Insert all backlinks in GROUP." (let ((file (car group)) - (backlinks (cdr group))) - (insert (format "** %s\n" - (org-roam-format-link - file - (org-roam-db--get-title file) - "file"))) + (backlinks (cdr group)) + (title (org-roam-format-link file + (org-roam-db--get-title file) + "file"))) + (nroam--insert-heading 3 title) (nroam--do-separated-by-newlines #'nroam-backlinks--insert-backlink backlinks))) (defun nroam-backlinks--insert-backlink (backlink) |