mirror of
https://github.com/foo-dogsquared/dotfiles.git
synced 2025-02-07 06:18:59 +00:00
Update custom wiki Doom module
This commit is contained in:
parent
233e6bac4e
commit
071b2f56b9
@ -14,9 +14,9 @@
|
||||
org-roam-directory "~/writings/wiki"
|
||||
org-roam-dailies-directory (f-join org-roam-directory "daily"))
|
||||
|
||||
(setq global-display-line-numbers-mode t)
|
||||
(setq display-line-numbers-type 'relative)
|
||||
(setq projectile-project-search-path '("~/projects/software/" "~/writings/"))
|
||||
(setq global-display-line-numbers-mode t
|
||||
display-line-numbers-type 'relative
|
||||
projectile-project-search-path '("~/projects/software/" "~/writings/"))
|
||||
|
||||
(setq
|
||||
time-stamp-format "%Y-%02m-%02d %02H:%02M:%02S %:z"
|
||||
@ -28,9 +28,15 @@
|
||||
org-journal-dir "~/writings/journal"
|
||||
org-journal-file-format "%F"
|
||||
|
||||
enable-local-variables "query")
|
||||
enable-local-variables "query"
|
||||
image-use-external-converter t
|
||||
org-startup-with-inline-images t)
|
||||
|
||||
(add-to-list 'org-modules 'org-habit)
|
||||
(add-to-list 'org-modules 'org-checklist)
|
||||
|
||||
(defvar my/wiki-asset-directory-name "assets")
|
||||
(defvar my/wiki-exercises-directory "challenges")
|
||||
|
||||
(defun my/create-assets-folder ()
|
||||
"A quick convenient function to create an assets folder in the wiki folder."
|
||||
@ -51,7 +57,6 @@
|
||||
(after! org
|
||||
(setq
|
||||
time-stamp-start "date_modified:[ ]+\\\\?[\"<]+"
|
||||
; Set the capture
|
||||
org-capture-templates `(
|
||||
("i" "inbox" entry
|
||||
(file ,(f-join org-directory "inbox.org"))
|
||||
@ -68,7 +73,6 @@
|
||||
"* TODO [[%:link][%:description]]\n%x"
|
||||
:immediate-finish t))
|
||||
|
||||
; Configure org-roam.
|
||||
org-roam-capture-templates `(
|
||||
("p" "permanent" plain "%?"
|
||||
:if-new
|
||||
@ -81,13 +85,21 @@
|
||||
|
||||
("c" "cards" plain "%?"
|
||||
:if-new
|
||||
(file+head ,(f-join "cards" "${slug}.org") "#+title: Anki: ${title}
|
||||
(file+head ,(f-join +anki-cards-directory-name "%<%Y>.org") "#+title: Anki: ${title}
|
||||
#+date: \"%<%Y-%m-%d %T %:z>\"
|
||||
#+date_modified: \"%<%Y-%m-%d %T %:z>\"
|
||||
#+language: en
|
||||
#+property: anki_deck ${title}")
|
||||
:unnarrowed t)
|
||||
|
||||
("C" "challenges" plain "%?"
|
||||
:if-new
|
||||
(file+head ,(f-join +wiki-directory my/wiki-exercises-directory "${slug}.org") "#+title: ${title}
|
||||
#+date: \"%<%Y-%m-%d %T %:z>\"
|
||||
#+date_modified: \"%<%Y-%m-%d %T %:z>\"
|
||||
#+language: en")
|
||||
:unnarrowed t)
|
||||
|
||||
("l" "literature" plain "%?"
|
||||
:if-new
|
||||
(file+head ,(f-join "literature" "%<%Y-%m-%d-%H-%M-%S>.org") "#+title: ${title}
|
||||
@ -98,22 +110,22 @@
|
||||
|
||||
("d" "dailies" entry "* %?"
|
||||
:if-new
|
||||
(file+head ,(expand-file-name "%<%Y-%m-%d>.org" org-roam-dailies-directory) "#+title: %<%Y-%m-%d>\n")))
|
||||
(file+head ,(expand-file-name "%<%Y-%m-%d>.org" org-roam-dailies-directory) "#+title: %<%Y-%m-%d>\n"))
|
||||
|
||||
("s" "structured" plain "%?"
|
||||
:if-new
|
||||
(file+head ,(f-join +structured-notes-directory-name "${slug}.org") "#+title: ${title}")
|
||||
:unnarrowed t))
|
||||
|
||||
org-roam-dailies-capture-templates `(("d" "default" entry "* %?"
|
||||
:if-new
|
||||
(file+head ,(expand-file-name "%<%Y-%m-%d>.org" org-roam-dailies-directory) "#+title: %<%Y-%m-%d>\n")))
|
||||
|
||||
;; Get the tags from vanilla and Roam-specific properties.
|
||||
org-roam-tag-sources '(prop vanilla))
|
||||
(add-to-list 'org-modules 'org-checklist))
|
||||
(file+head ,(expand-file-name "%<%Y-%m-%d>.org" org-roam-dailies-directory) "#+title: %<%Y-%m-%d>\n")))))
|
||||
|
||||
;; Custom keybindings
|
||||
(map!
|
||||
(:when (featurep! :tools wiki)
|
||||
:leader
|
||||
:prefix "nr"
|
||||
:desc "Create the asset folder" "m" #'my/create-assets-folder)
|
||||
:prefix "nr" :desc "Create the asset folder" "m" #'my/create-assets-folder)
|
||||
|
||||
(:when (featurep! :editor format)
|
||||
:n "g=" #'+format/buffer))
|
||||
@ -127,7 +139,9 @@
|
||||
(add-hook! 'before-save-hook 'time-stamp)
|
||||
|
||||
;; 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)
|
||||
|
||||
;; Load a custom configuration for muh wiki.
|
||||
(load-file (f-join +wiki-directory "config.el"))
|
||||
|
||||
;;; config.el ends here
|
||||
|
@ -186,4 +186,5 @@
|
||||
|
||||
:tools
|
||||
(wiki +anki
|
||||
+dendron))
|
||||
+dendron
|
||||
+biblio))
|
||||
|
3
emacs/modules/tools/wiki/README.org
Normal file → Executable file
3
emacs/modules/tools/wiki/README.org
Normal file → Executable file
@ -1,6 +1,6 @@
|
||||
#+title: tools/wiki
|
||||
#+date: "2021-05-05 00:27:26 +08:00"
|
||||
#+date_modified: "2021-05-08 12:28:46 +08:00"
|
||||
#+date_modified: "2021-05-21 11:12:10 +08:00"
|
||||
#+language: en
|
||||
|
||||
|
||||
@ -20,7 +20,6 @@ The setup uses org-roam v2.
|
||||
- ~+markdown~ adds Markdown support in org-roam.
|
||||
|
||||
|
||||
|
||||
** Plugins
|
||||
|
||||
- [[https://github.com/org-roam/org-roam/][org-roam]] v2
|
||||
|
29
emacs/modules/tools/wiki/config.el
Normal file → Executable file
29
emacs/modules/tools/wiki/config.el
Normal file → Executable file
@ -9,6 +9,14 @@
|
||||
;;; Code:
|
||||
(defvar +wiki-directory "~/wiki")
|
||||
|
||||
(defun +org-roam-split-to-random-node ()
|
||||
"Open a split window sensibly for a random note."
|
||||
; TODO: Create a window, open a random note, and that's it.
|
||||
(interactive)
|
||||
(split-window-sensibly)
|
||||
(other-window 1)
|
||||
(org-roam-node-random))
|
||||
|
||||
(use-package! org-roam
|
||||
:hook (org-load . org-roam-mode)
|
||||
:commands
|
||||
@ -24,7 +32,8 @@
|
||||
:after org
|
||||
:map org-roam-dailies-map
|
||||
(:prefix ("n r" . "org-roam")
|
||||
:desc "Go to a random node" "R" #'org-roam-node-random
|
||||
:desc "Go to a random node" "r" #'org-roam-node-random
|
||||
:desc "Go to a random node and split" "R" #'+org-roam-split-to-random-node
|
||||
:desc "Find node" "f" #'org-roam-node-find
|
||||
:desc "Org Roam capture" "c" #'org-roam-capture
|
||||
:desc "Org Roam setup" "s" #'org-roam-setup
|
||||
@ -46,6 +55,22 @@
|
||||
org-roam-dailies-directory (f-join +wiki-directory "daily"))
|
||||
(org-roam-setup))
|
||||
|
||||
(when (featurep! +biblio)
|
||||
(defvar +wiki-references-filename "references.bib")
|
||||
(defvar +wiki-bibliography-note-filename "references.org")
|
||||
(defvar +wiki-bibliography (f-join +wiki-directory +wiki-references-filename))
|
||||
(defvar +wiki-bibliography-note (f-join +wiki-directory +wiki-bibliography-note-filename))
|
||||
|
||||
(use-package! org-ref
|
||||
:after org-roam
|
||||
:config
|
||||
(setq +wiki-bibliography (f-join +wiki-directory +wiki-references-filename)
|
||||
org-ref-default-bibliography +wiki-bibliography
|
||||
org-ref-bibliography-notes +wiki-bibliography-note))
|
||||
|
||||
(use-package! org-roam-bibtex
|
||||
:after org-roam))
|
||||
|
||||
(when (featurep! +anki)
|
||||
(defvar +anki-cards-directory-name "cards")
|
||||
(defvar +anki-cards-directory (f-join +wiki-directory +anki-cards-directory-name))
|
||||
@ -61,6 +86,7 @@
|
||||
"Reset the Anki notes in the current buffer by deleting the note ID and the deck."
|
||||
(interactive)
|
||||
(anki-editor-map-note-entries #'+anki-editor-reset-note))
|
||||
|
||||
(use-package! anki-editor
|
||||
:hook (org-mode . anki-editor-mode)
|
||||
:preface
|
||||
@ -84,6 +110,7 @@
|
||||
(when (featurep! +dendron)
|
||||
(defvar +structured-notes-directory-name "structured")
|
||||
(defvar +structured-notes-directory (f-join +wiki-directory +structured-notes-directory-name))
|
||||
|
||||
(use-package! dendroam
|
||||
:after org-roam
|
||||
:preface (defvar +wiki-directory nil)
|
||||
|
7
emacs/modules/tools/wiki/doctor.el
Normal file → Executable file
7
emacs/modules/tools/wiki/doctor.el
Normal file → Executable file
@ -3,3 +3,10 @@
|
||||
|
||||
(unless (executable-find "sqlite3")
|
||||
warn! "Couldn't find SQLite executable. org-roam will not work.")
|
||||
|
||||
(when (featurep! +biblio)
|
||||
(unless (executable-find "anystyle")
|
||||
warn! "Couldn't find AnyStyle CLI. The PDF scrapper from org-roam-bibtex will not work.")
|
||||
|
||||
(unless (featurep! :tools biblio)
|
||||
warn! "Doom module ':tools biblio' is not enabled. Completion functions will not work."))
|
||||
|
4
emacs/modules/tools/wiki/packages.el
Normal file → Executable file
4
emacs/modules/tools/wiki/packages.el
Normal file → Executable file
@ -7,7 +7,9 @@
|
||||
|
||||
(when (featurep! +biblio)
|
||||
(package! org-ref
|
||||
:recipe (:host github :repo "jkitchin/org-ref")))
|
||||
:recipe (:host github :repo "jkitchin/org-ref"))
|
||||
(package! org-roam-bibtex
|
||||
:recipe (:host github :repo "org-roam/org-roam-bibtex" :branch "org-roam-v2")))
|
||||
|
||||
(when (featurep! +anki)
|
||||
(package! anki-editor
|
||||
|
7
emacs/snippets/org-mode/begin
Executable file
7
emacs/snippets/org-mode/begin
Executable file
@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: Org mode basic block
|
||||
# key: begin
|
||||
# --
|
||||
#+begin_$1
|
||||
$0
|
||||
#+end_$1
|
@ -2,6 +2,6 @@
|
||||
# name: Org-Mode dynamic blocks
|
||||
# key: block
|
||||
# --
|
||||
\#+begin: ${1:<PARAMETERS>}
|
||||
#+begin: ${1:<PARAMETERS>}
|
||||
$2
|
||||
\#+end:
|
||||
#+end:
|
||||
|
Loading…
Reference in New Issue
Block a user