From a1f9243cf049ee4260d41a4c71db91b2c79ff89a Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Tue, 6 Apr 2021 11:00:08 -0700 Subject: [PATCH] [org-roam] Add capture templates for reading --- oni-org-roam.el | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/oni-org-roam.el b/oni-org-roam.el index da93d69..7a95090 100644 --- a/oni-org-roam.el +++ b/oni-org-roam.el @@ -4,7 +4,7 @@ ;; Author: Tom Willemse ;; Keywords: local -;; Version: 2021.0328.113628 +;; Version: 2021.0404.224750 ;; Package-Requires: (oni-org org-roam nroam) ;; This program is free software; you can redistribute it and/or modify @@ -30,6 +30,40 @@ (setq org-roam-directory (expand-file-name "~/documents/org/")) +(defvar oni-org-roam-file-name-format "%<%Y%m%d%H%M%S>-${slug}") + +(defvar oni-org-roam-book-head "#+title: ${title} + +- book :: +- chapter :: +- url :: +- tags :: + +") + +(add-to-list 'org-roam-capture-templates + `("B" "Bookclub book" plain (function org-roam-capture--get-point) + "* What do I want to say about this chapter? + +- %? + +* What did I learn from this chapter? + +- + +* What did I want to talk about in this chapter? + +-" + :file-name ,oni-org-roam-file-name-format + :head ,oni-org-roam-book-head + :unnarrowed t)) + +(add-to-list 'org-roam-capture-templates + `("b" "Book" plain (function org-roam-capture--get-point) "%?" + :file-name ,oni-org-roam-file-name-format + :head ,oni-org-roam-book-head + :unnarrowed t)) + (add-hook 'org-mode-hook 'nroam-setup-maybe) (org-roam-mode)