The Good Org Roam Development Environment (GORDE) provides a simple set of Org Roam
templates & dir-locals.el
configurations to create reproducible test environments for
Org Roam development.
The goal of this repo is to provide a stable set of templates to generate realistic Org Roam instances that facilitate safer & more efficient development of Org Roam Extensions.
Resetting the environment consists of removing any org files in this dir, then repopulating the base files by tangling this file.
To reset, remove the :noeval
header arg, then execute the block.
find . -name "*.org" -not -iname "*readme*" | xargs -I {} rm {}
Then tangle this file to generate the core project files.
(org-babel-tangle)
(org-roam-db-sync)
Configure Org Roam behavior within .dir-locals.el
to behave relative to this project’s
current directory.
A local variable project-root-path
holds the base directory name desired for any
environment-specific paths.
((nil . ((eval . (setq project-root-path
;; Find out what dir we're in, and ensure we have
;; it in string format.
(file-name-directory
(let ((curdir (dir-locals-find-file "./")))
(if (stringp curdir)
curdir
(car curdir))))))))
;; These two are important, if not set correctly your REAL org roam instance
;; may be modified.
(org-mode . ((eval . (setq-local org-roam-directory project-root-path))
(eval . (setq-local org-roam-db-location (concat project-root-path ".org-roam.db")))
;; We load in some extra languages for convenience
(eval . (org-babel-do-load-languages 'org-babel-load-languages
'((sql . t)
(lisp . t)
(nix . t)
(bash . t)
(sh . t)
(sqlite . t)
(org . t)
(python . t)
(R . t)
(shell . t)
(emacs-lisp . t)))))))
Work in progress.
To simplify the process of reading some common values sought during development, the Debugger.org file is regularly updated with stats about this development Org Roam instances.
Properties are human readable, and ephemeral. The file updates based on a file-watcher targeting the Gorde directory.
(defun update-debug-dashboard (&optional event debug-dash-file)
"Update the DEBUG-DASH-FIlE file when EVENT received."
(message "Type of Event:\t%S" (type-of event))
(message "test for dupes.....")
(message "Event:\t%S" event)
; Find org roam file
; For each debugging property
; find the appropriate heading
; insert new data
; save & close file
)
(setq gorde-file-watch-descriptor (file-notify-add-watch
project-root-path
'(change attribute-change)
'update-debug-dashboard))
(file-notify-rm-watch gorde-file-watch-descriptor)