|
|
@ -42,8 +42,9 @@ The default behaviour of ~org-roam~ when creating a title slug is to replace any |
|
|
|
+ Override ~org-roam-title-to-slug-function~ |
|
|
|
|
|
|
|
#+begin_src emacs-lisp |
|
|
|
(require 'cl-lib) |
|
|
|
(defun dotfiles/title-to-slug (title) |
|
|
|
(with-eval-after-load 'org-roam |
|
|
|
(require 'cl-lib) |
|
|
|
(defun dotfiles/title-to-slug (title) |
|
|
|
"Convert TITLE to a filename-suitable slug." |
|
|
|
(cl-flet* ((nonspacing-mark-p (char) |
|
|
|
(eq 'Mn (get-char-code-property char 'general-category))) |
|
|
@ -58,7 +59,7 @@ The default behaviour of ~org-roam~ when creating a title slug is to replace any |
|
|
|
("-$" . ""))) ;; Remove ending dashes. |
|
|
|
(slug (-reduce-from #'cl-replace (strip-nonspacing-marks title) pairs))) |
|
|
|
(downcase slug)))) |
|
|
|
(setq org-roam-title-to-slug-function #'dotfiles/title-to-slug) |
|
|
|
(setq org-roam-title-to-slug-function #'dotfiles/title-to-slug)) |
|
|
|
#+end_src |
|
|
|
|
|
|
|
** Visualizer |
|
|
@ -76,7 +77,8 @@ Use the ~org-roam-server~ web application to visualize the ~org-roam~ database. |
|
|
|
Use the ~daily~ note feature of ~org-roam~ to capture daily notes. Create the default capture template with some preconfigured headers. |
|
|
|
|
|
|
|
#+begin_src emacs-lisp |
|
|
|
(add-to-list 'org-roam-dailies-capture-templates |
|
|
|
(with-eval-after-load 'org-roam |
|
|
|
(add-to-list 'org-roam-dailies-capture-templates |
|
|
|
'("d" "Default" entry (function org-roam-capture--get-point) |
|
|
|
"* %?" |
|
|
|
:file-name "docs/daily/%<%Y-%m-%d>" |
|
|
@ -87,7 +89,7 @@ Use the ~daily~ note feature of ~org-roam~ to capture daily notes. Create the de |
|
|
|
|
|
|
|
,#+OPTIONS: num:nil toc:nil todo:nil tasks:nil tags:nil |
|
|
|
,#+OPTIONS: skip:nil author:nil email:nil creator:nil timestamp:nil |
|
|
|
")) |
|
|
|
"))) |
|
|
|
#+end_src |
|
|
|
|
|
|
|
* Templates |
|
|
@ -95,7 +97,8 @@ Use the ~daily~ note feature of ~org-roam~ to capture daily notes. Create the de |
|
|
|
Collection of capture templates for various contexts. Here is one for a generic document. |
|
|
|
|
|
|
|
#+begin_src emacs-lisp |
|
|
|
(add-to-list 'org-roam-capture-templates |
|
|
|
(with-eval-after-load 'org-roam |
|
|
|
(add-to-list 'org-roam-capture-templates |
|
|
|
'("d" "Default" entry (function org-roam-capture--get-point) |
|
|
|
"%?" |
|
|
|
:file-name "docs/${slug}" |
|
|
@ -105,7 +108,7 @@ Collection of capture templates for various contexts. Here is one for a generic |
|
|
|
,#+TITLE: ${title} |
|
|
|
,#+AUTHOR: Christopher James Hayward |
|
|
|
,#+EMAIL: chris@chrishayward.xyz |
|
|
|
")) |
|
|
|
"))) |
|
|
|
#+end_src |
|
|
|
|
|
|
|
** Course |
|
|
@ -113,7 +116,8 @@ Collection of capture templates for various contexts. Here is one for a generic |
|
|
|
Capture template for a new course. Capture with =SPC r c c=. |
|
|
|
|
|
|
|
#+begin_src emacs-lisp |
|
|
|
(add-to-list 'org-roam-capture-templates |
|
|
|
(with-eval-after-load 'org-roam |
|
|
|
(add-to-list 'org-roam-capture-templates |
|
|
|
'("c" "Course" plain (function org-roam-capture--get-point) |
|
|
|
"%?" |
|
|
|
:file-name "docs/courses/${slug}" |
|
|
@ -127,7 +131,7 @@ Capture template for a new course. Capture with =SPC r c c=. |
|
|
|
|
|
|
|
,#+OPTIONS: num:nil toc:nil todo:nil tasks:nil tags:nil |
|
|
|
,#+OPTIONS: skip:nil author:nil email:nil creator:nil timestamp:nil |
|
|
|
")) |
|
|
|
"))) |
|
|
|
#+end_src |
|
|
|
|
|
|
|
* Shortcuts |
|
|
|