Visually separate different groups of priorities in backlinks dblock
Use an hline for this, should increase readability.
This commit is contained in:
parent
10e01d4b3b
commit
b03a8f9517
|
@ -1093,13 +1093,18 @@ PARAMS may contain the following values:
|
||||||
;; Format output-lines as Org table
|
;; Format output-lines as Org table
|
||||||
(insert (format "| Backlink | Prio | Backlink Target(s) |\n|---|"))
|
(insert (format "| Backlink | Prio | Backlink Target(s) |\n|---|"))
|
||||||
(when output-lines
|
(when output-lines
|
||||||
(dolist (line output-lines)
|
(let (pp) ; pervious-priority, to draw hlines between groups of same priority
|
||||||
(insert (format "\n| %s | %s | %s |"
|
(dolist (line output-lines)
|
||||||
(cl-first line) ; backlink
|
(when (and pp (not (equal pp (cl-second line))))
|
||||||
(cl-second line) ; priority
|
(insert "\n|--|"))
|
||||||
(apply #'concat (-interpose ", " (cl-third line))) ; backlink targets
|
(setq pp (cl-second line))
|
||||||
)))
|
(insert
|
||||||
(insert "\n|---|"))
|
(format "\n| %s | %s | %s |"
|
||||||
|
(cl-first line) ; actual backlink
|
||||||
|
pp ; current priority
|
||||||
|
(apply #'concat ; backlink targets, separated by comma
|
||||||
|
(-interpose ", " (cl-third line))))))
|
||||||
|
(insert "\n|---|")))
|
||||||
(org-table-align)))
|
(org-table-align)))
|
||||||
|
|
||||||
(defun db/org-insert-backlink-block ()
|
(defun db/org-insert-backlink-block ()
|
||||||
|
|
Loading…
Reference in New Issue