* Org Mode

Org mode is a handy note taking, todo list managing, journal writing, and literate
programming tool among other things.  I use it for writing some of my configurations,
and managing my notes.

#+begin_src emacs-lisp
(use-feature org
  :defer t
  :config
  (require 'org-agenda)
  (setq org-confirm-babel-evaluate nil)
  :custom
  (org-ellipsis (nth 5 '("↴" "˅" "…" " ⬙" " ▽" "▿")))
  (org-priority-lowest ?D)
  (org-fontify-done-headline t)
  (global-set-key (kbd "C-c l") #'org-store-link)
  (global-set-key (kbd "C-c a") #'org-agenda)
  (global-set-key (kbd "C-c c") #'org-capture))
#+end_src

** Htmlize

The [[https://github.com/emacsorphanage/htmlize/blob/master/htmlize.el#start-of-content][htmlize]] package enables exporting org documents, and other buffers into HTML
format.

#+begin_src emacs-lisp
(use-package htmlize
  :after (org)
  :defer t)
#+end_src

** Org Modern

[[https://github.com/minad/org-modern][org-modern]] provides a cleaner representation of org documents while being
edited.  It displays the intended formatting without all the markup.

#+begin_src emacs-lisp
(use-package org-modern
  :after (org)
  :config
  (global-org-modern-mode)
  (remove-hook 'org-agenda-finalize-hook 'org-modern-agenda))
#+end_src

** Literate Tools

These are packages useful for literate programming, and its presentation.  Though
not necessarily exlusive to literate programming as they can improve the look of
most any org document.

#+begin_src emacs-lisp
(use-feature ob-tangle
  :after (org)
  :custom
  (org-src-window-setup 'current-window)
  (org-src-preserve-indentation t))

;; Maybe unnecessary... I'll see.
(use-package org-contrib)

(use-package org-make-toc
  :commands (org-make-toc))
#+end_src

** Note Taking
Org-roam is my go to for note taking.  While out of the box it isn't quite as snazzy
as something like Obsidian it does offer a lot of flexibility that no other note
taking tool has.

#+begin_src emacs-lisp
(use-package org-roam
  :after (org)
  :ensure t
  :bind (("C-c n l" . org-roam-buffer-toggle)
         ("C-c n f" . org-roam-node-find)
         ("C-c n i" . org-roam-node-insert))
  :config
  (setq org-roam-directory "~/Documents/org-roam"
        org-roam-dailies-directory "daily/")

  (setq org-roam-capture-templates
        '(("d" "default plain" plain
           "%?"
           :if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org"
                              "#+title: ${title}\n"))
          ("D" "default encrypted" plain
           "%?"
           :if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org.gpg"
                              "#+title: ${title}\n"))))

  (setq org-roam-dailies-capture-templates
        '(("d" "default" plain
           "%?"
           :target (file+head "%<%Y-%m-%d>.org"
                              "#+title: %<%Y-%m-%d>\n\n* Tasks\n\n* Notes"))))

  (org-roam-db-autosync-mode))

(use-package orgmdb
  :ensure t)

(use-package org-roam-ui
  :after (org-roam)
  :ensure t
  :config
  (setq org-roam-ui-sync-theme t
        org-roam-ui-follow t
        org-roam-ui-update-on-save t
        org-roam-ui-open-on-start t))
#+end_src

