feat(notetaking): anki integration

This commit is contained in:
Tibo De Peuter 2026-06-20 19:58:49 +02:00
parent d9babbd49a
commit f6ec07f646
No known key found for this signature in database
GPG key ID: 9187B5FA0F4B6F6D
4 changed files with 131 additions and 44 deletions

59
notetaking/.gitignore vendored Normal file
View file

@ -0,0 +1,59 @@
# -*- mode: gitignore; -*-
*~
\#*\#
/.emacs.desktop
/.emacs.desktop.lock
*.elc
auto-save-list
tramp
.\#*
# Org-mode
.org-id-locations
*_archive
# flymake-mode
*_flymake.*
# eshell files
/eshell/history
/eshell/lastdir
# elpa packages
/elpa/
# reftex files
*.rel
# AUCTeX auto folder
/auto/
# cask packages
.cask/
dist/
# Flycheck
flycheck_*.el
# server auth directory
/server/
# projectiles files
.projectile
# directory configuration
.dir-locals.el
# network security
/network-security.data
# undo-tree
*.~undo-tree~
# org-roam
bookmarks
eln-cache/
history
org-roam.db
places
request/

View file

@ -19,6 +19,32 @@
plugins = with pkgs.emacsPackages; [
];
emacsDependencies = with pkgs; [
hunspell
hunspellDicts.nl_NL
hunspellDicts.en_GB-large
ghostscript
graphviz
imagemagickBig
poppler-utils
ripgrep
wl-clipboard
# Any less than medium isn't guaranteed to work
(texlive.withPackages (ps: with ps; [
scheme-medium
latexmk
# File '*.sty' not found
capt-of
preview
standalone
wrapfig
]))
# required by +jupyter
(python314.withPackages (ps: with ps; [ jupyter ]))
];
in {
devShells.default = pkgs.mkShell {
packages = [
@ -28,38 +54,27 @@
package = pkgs.emacs; # pkgs.emacs-git
extraEmacsPackages = epkgs: [
epkgs.unicode-fonts
epkgs.pdf-tools
epkgs.org-anki
epkgs.org-pdftools
epkgs.pdf-tools
epkgs.unicode-fonts
pkgs.shellcheck
];
})
pkgs.hunspell
pkgs.hunspellDicts.nl_NL
pkgs.hunspellDicts.en_GB-large
pkgs.ghostscript
pkgs.graphviz
pkgs.imagemagickBig
pkgs.poppler-utils
pkgs.ripgrep
(pkgs.anki.withAddons [
#(pkgs.ankiAddons.passfail2.withConfig {
# config = {
# again_button_name = "Incorrect";
# good_button_name = "Correct";
# };
#})
pkgs.wl-clipboard
# Any less than medium isn't guaranteed to work
(pkgs.texlive.withPackages (ps: with ps; [
scheme-medium
latexmk
# File '*.sty' not found
capt-of
preview
standalone
wrapfig
]))
# required by +jupyter
(pkgs.python314.withPackages (ps: with ps; [ jupyter ]))
];
pkgs.ankiAddons.anki-connect
pkgs.pandoc
])
] ++ emacsDependencies;
};
});
}

View file

@ -114,22 +114,7 @@
(pdf-loader-install)
)
(use-package org-preview-html ;; https://github.com/jakebox/org-preview-html
:ensure t
:bind (:map org-mode-map ("C-c p" . org-preview-html-mode))
:custom
(org-preview-html-viewer 'eww) ;; Use built-in EWW browser
(org-preview-html-refresh-configuration 'save)
(add-hook 'eww-mode-hook (lambda () (display-line-numbers-mode -1)))
;; Pin the preview window layout to the right
(add-to-list 'display-buffer-alist
'("\\*eww\\*"
(display-buffer-in-direction)
(direction . right)
(window-width . 0.5)
)
)
)
;; Theming
(use-package olivetti
:ensure t
@ -169,8 +154,6 @@
;; TODO Automatically save buffer when going to other file -- maybe interactively?
;; TODO Spellchecking (UK & Dutch)
;; TODO Some automation to create anki cards intext without having to write the boilerplate
;; TODO Finally, compare experience to organice https://organice.200ok.ch/
;; TODO org-compile-file: File "/tmp/nix-shell.UEk6Ye/orgtexcJso3E.dvi" wasnt produced Please adjust dvipng part of org-preview-latex-process-alist.

View file

@ -65,7 +65,7 @@
(org-roam-dailies-directory "dailies/")
(org-roam-completion-everywhere t)
:bind (
("C-c r f" . org-roam-node-find)
("C-c r f" . org-roam-node-find) ;; TODO This is case sensitive, make it insensitive
("C-c r j" . org-roam-dailies-capture-today)
("C-c r t" . org-roam-dailies-goto-today)
)
@ -110,3 +110,33 @@
("C-c i" . org-download-clipboard)
)
(use-package org-preview-html ;; https://github.com/jakebox/org-preview-html
:ensure t
:bind (:map org-mode-map ("C-c p" . org-preview-html-mode))
:custom
(org-preview-html-viewer 'eww) ;; Use built-in EWW browser
(org-preview-html-refresh-configuration 'save)
(add-hook 'eww-mode-hook (lambda () (display-line-numbers-mode -1)))
;; Pin the preview window layout to the right
(add-to-list 'display-buffer-alist
'("\\*eww\\*"
(display-buffer-in-direction)
(direction . right)
(window-width . 0.5)
)
)
)
;; Integrations
(use-package org-anki ;; https://github.com/eyeinsky/org-anki
:ensure t
:bind (:map org-mode-map
("C-c a c" . org-anki-cloze-dwim) ;; Insert cloze on cursor
("C-c a d" . org-anki-delete-entry) ;; Delete cards from Anki
("C-c a i" . org-anki-sync-entry) ;; Create card from current header
("C-c a s" . org-anki-sync-all) ;; Sync all cards in buffer
("C-c a u" . org-anki-update-all) ;; Update existing cards in buffer
)
)