mirror of
https://github.com/org-roam/org-roam
synced 2025-09-28 16:50:58 -05:00
(feature): allow customization of graphviz node appearance (#132)
This commit is contained in:
22
org-roam.el
22
org-roam.el
@@ -123,6 +123,16 @@ If nil, always ask for filename."
|
||||
:type 'string
|
||||
:group 'org-roam)
|
||||
|
||||
(defcustom org-roam-graph-max-title-length 100
|
||||
"Maximum length of titles in graphviz graph nodes"
|
||||
:type 'number
|
||||
:group 'org-roam)
|
||||
|
||||
(defcustom org-roam-graph-node-shape "ellipse"
|
||||
"Maximum length of titles in graphviz graph nodes"
|
||||
:type 'string
|
||||
:group 'org-roam)
|
||||
|
||||
;;; Polyfills
|
||||
;; These are for functions I use that are only available in newer Emacs
|
||||
|
||||
@@ -507,10 +517,16 @@ Bindings:
|
||||
(with-temp-buffer
|
||||
(insert "digraph {\n")
|
||||
(dolist (file (org-roam--find-all-files))
|
||||
(let ((title (org-roam--get-title-or-slug file)))
|
||||
(let ((shortened-title (s-truncate org-roam-graph-max-title-length title)))
|
||||
(insert
|
||||
(format " \"%s\" [URL=\"roam://%s\"];\n"
|
||||
(org-roam--get-title-or-slug file)
|
||||
file)))
|
||||
(format " \"%s\" [label=\"%s\", shape=%s, URL=\"roam://%s\", tooltip=\"%s\"];\n"
|
||||
title
|
||||
shortened-title
|
||||
org-roam-graph-node-shape
|
||||
file
|
||||
title
|
||||
)))))
|
||||
(maphash
|
||||
(lambda (from-link to-links)
|
||||
(dolist (to-link to-links)
|
||||
|
Reference in New Issue
Block a user