diff --git a/emacs/config.el b/emacs/config.el index 5e4c037..5dc59cb 100755 --- a/emacs/config.el +++ b/emacs/config.el @@ -15,7 +15,8 @@ (setq doom-theme 'doom-nord) (setq org-directory "~/writings/orgnotes" - org-roam-directory "~/writings/wiki") + org-roam-directory "~/writings/wiki" + org-roam-dailies-directory (concat org-roam-directory "/daily")) ;; This determines the style of line numbers in effect. If set to `nil', line ;; numbers are disabled. For relative line numbers, set this to `relative'. @@ -121,6 +122,7 @@ (setq ;; Modify the time-stamp with each save. time-stamp-format "%Y-%02m-%02d %02H:%02M:%02S %:z" + org-id-link-to-org-use-id t ;; Set file templates folder at $DOOMDIR/templates. +file-templates-dir (expand-file-name "templates/" doom-private-dir) @@ -145,18 +147,8 @@ ;; Automate updating timestamps on save. (add-hook! 'before-save-hook 'time-stamp) -;; Set up Anki editor -(use-package! anki-editor - :hook (org-mode . anki-editor-mode) - :config - (setq anki-editor-create-decks 't) - (map! :localleader - :map org-mode-map - (:prefix ("C" . "Anki cards") - "p" #'anki-editor-push-notes - "r" #'anki-editor-retry-failure-notes - "i" #'anki-editor-insert-note - "I" #'anki-editor-cloze-region - "e" #'anki-editor-export-subtree-to-html))) +;; Add a capture hook. +(add-hook! 'org-capture-prepare-finalize-hook 'org-id-get-create) +(add-hook! 'org-roam-capture-new-node-hook 'org-id-get-create) ;;; config.el ends here diff --git a/emacs/init.el b/emacs/init.el index f6d7d1a..3e88c93 100755 --- a/emacs/init.el +++ b/emacs/init.el @@ -14,7 +14,12 @@ ;; Alternatively, press 'gd' (or 'C-c g d') on a module to browse its ;; directory (for easy access to its source code). -(doom! :input +(doom! + ;; All custom modules will be put here. + :tools + (wiki +anki) + + :input ;;chinese japanese @@ -146,8 +151,7 @@ +journal +noter +pandoc - +present - +roam) ; organize your plain life in plain text + +present) ; organize your plain life in plain text raku ; write code no one else can comprehend ;;php ; perl's insecure younger brother ;;plantuml ; diagrams for confusing people more @@ -183,6 +187,4 @@ :config ;;literate - (default +bindings +smartparens) -) - + (default +bindings +smartparens)) diff --git a/emacs/modules/tools/wiki/config.el b/emacs/modules/tools/wiki/config.el new file mode 100644 index 0000000..9ae6cb3 --- /dev/null +++ b/emacs/modules/tools/wiki/config.el @@ -0,0 +1,42 @@ +;;; tools/wiki/config.el -*- lexical-binding: t; -*- + +;; My custom configuration for setting up my personal wiki. +;; Also a good opportunity for training my Elisp-fu. + +(use-package! org-roam + :hook (org-load . org-roam-mode) + :commands + (org-roam-buffer + org-roam-setup + org-roam-capture + org-roam-node-find) + :preface (defvar org-roam-directory nil) + :config + (setq org-roam-completion-everywhere t) + (org-roam-setup) + (map! :leader + (:prefix ("n r" . "org-roam") + :desc "Go to a random node in your Roam database" "R" #'org-roam-node-random + :desc "Find node" "f" #'org-roam-node-find + :desc "Org Roam capture" "c" #'org-roam-capture + :desc "Org Roam setup" "s" #'org-roam-setup + :desc "Org Roam teardown" "S" #'org-roam-teardown + :desc "Open backlinks buffer" "b" #'org-roam-buffer-toggle + + (:prefix ("d" . "dailies") + :desc "Dailies for today" "t" #'org-roam-dailies-find-today + :desc "Dailies for a specific date" "d" #'org-roam-dailies-find-date + :desc "Dailies for yesterday" "y" #'org-roam-dailies-find-yesterday)))) + +(use-package! anki-editor + :hook (org-mode . anki-editor-mode) + :config + (setq anki-editor-create-decks 't) + (map! :localleader + :map org-mode-map + (:prefix ("C" . "Anki cards") + "p" #'anki-editor-push-notes + "r" #'anki-editor-retry-failure-notes + "i" #'anki-editor-insert-note + "I" #'anki-editor-cloze-region + "e" #'anki-editor-export-subtree-to-html))) diff --git a/emacs/modules/tools/wiki/doctor.el b/emacs/modules/tools/wiki/doctor.el new file mode 100644 index 0000000..1d53645 --- /dev/null +++ b/emacs/modules/tools/wiki/doctor.el @@ -0,0 +1,5 @@ +;; -*- lexical-binding: t; no-byte-compile: t; -*- +;;; tools/wiki/doctor.el + +(unless (executable-find "sqlite3") + warn! "Couldn't find SQLite executable. org-roam will not work.") diff --git a/emacs/modules/tools/wiki/packages.el b/emacs/modules/tools/wiki/packages.el new file mode 100644 index 0000000..495b579 --- /dev/null +++ b/emacs/modules/tools/wiki/packages.el @@ -0,0 +1,20 @@ +;; -*- no-byte-compile: t; -*- +;;; tools/wiki + +;; The main package for creating a wiki. +(package! org-roam + :recipe (:host github :repo "org-roam/org-roam" :branch "v2")) + +(when (featurep! +anki) + (package! anki-editor + :recipe (:host github + :repo "louietan/anki-editor") + :pin "546774a453ef4617b1bcb0d1626e415c67cc88df")) + +;;(when (featurep! +markdown) +;; (package! md-roam +;; :recipe (:host github :repo "nobiot/md-roam" :branch "v2"))) +;; +;;(when (featurep! +dendron) +;; (package! dendroam +;; :recipe (:host github :repo "vicrdguez/dendroam"))) diff --git a/emacs/packages.el b/emacs/packages.el index 902cf19..4f2e86d 100755 --- a/emacs/packages.el +++ b/emacs/packages.el @@ -51,25 +51,5 @@ ;;;;;;;;;;;; ; PACKAGES ; ;;;;;;;;;;;; -;;(package! flycheck-vale) -(package! org-roam-bibtex - :recipe (:host github - :repo "org-roam/org-roam-bibtex")) - ;; Inline errors? Hoorah! (package! flycheck-inline) - -;; Since org-roam-bibtex is a connector to all of the specified packages and in alpha stage, it can be problematic so we'll disable it for now. -;(unpin! org-roam company-org-roam) - -; A minimap in case you have Stockholm Syndrome for your bloated IDEs. :) -(package! minimap - :recipe (:host github - :repo "dengste/minimap") - :pin "8bc9a65825925a7c58b83ad389f07a93f22d60f3") - -; Anki -(package! anki-editor - :recipe (:host github - :repo "louietan/anki-editor") - :pin "546774a453ef4617b1bcb0d1626e415c67cc88df")