feat[captures] Removed defunct school template
Added error-check to not use Hack font if not present. Began work on filter for inline anki links
This commit is contained in:
parent
17d5fdf03b
commit
d951d543ed
84
config.org
84
config.org
@ -36,10 +36,13 @@ Some basic settings for Emacs
|
|||||||
Set the theme.
|
Set the theme.
|
||||||
/Use something dark/
|
/Use something dark/
|
||||||
+I also prefer relative line numbers because of *evil* mode+
|
+I also prefer relative line numbers because of *evil* mode+
|
||||||
Relative line numbers don't work, because of foling in Org-mode.
|
Relative line numbers don't seem to work, because of folding in Org-mode.
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(setq doom-theme 'doom-homage-black)
|
(setq doom-theme 'doom-one)
|
||||||
(setq doom-font (font-spec :family "Hack Nerd Font Mono" :size 16 :weight 'medium))
|
(condition-case nil
|
||||||
|
(setq doom-font (font-spec :family "Hack Nerd Font Mono" :size 16 :weight 'medium))
|
||||||
|
(error (set-face-attribute 'default nil :height 130)))
|
||||||
|
|
||||||
(setq auto-save-default nil) ;I don't like autosaving. Let me do it myself.
|
(setq auto-save-default nil) ;I don't like autosaving. Let me do it myself.
|
||||||
#+end_src
|
#+end_src
|
||||||
** Doom splash screen
|
** Doom splash screen
|
||||||
@ -122,6 +125,14 @@ Because I sometimes use Fish or another shell, it's good to make sure bash is ru
|
|||||||
:desc "Insert the current date into the buffer"
|
:desc "Insert the current date into the buffer"
|
||||||
"i d" #'insert-current-date)
|
"i d" #'insert-current-date)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
** Convert regex strings to rx
|
||||||
|
#+begin_src elisp :tangle packages.el
|
||||||
|
(package! xr)
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
#+begin_src elisp
|
||||||
|
(use-package! xr)
|
||||||
|
#+end_src
|
||||||
* Creating Diagrams and graphs
|
* Creating Diagrams and graphs
|
||||||
** TODO set default values using org-babel's features for that.
|
** TODO set default values using org-babel's features for that.
|
||||||
|
|
||||||
@ -149,8 +160,6 @@ Because I sometimes use Fish or another shell, it's good to make sure bash is ru
|
|||||||
:END:
|
:END:
|
||||||
This preprocessor script allows me to use Ripgrep with Age to filter agenda files.
|
This preprocessor script allows me to use Ripgrep with Age to filter agenda files.
|
||||||
You can see the configuration for that in [[#agenda-efficient][this section]].
|
You can see the configuration for that in [[#agenda-efficient][this section]].
|
||||||
|
|
||||||
|
|
||||||
#+begin_src zsh :tangle "/home/user/age-preprocessor.zsh"
|
#+begin_src zsh :tangle "/home/user/age-preprocessor.zsh"
|
||||||
#!/usr/bin/env zsh
|
#!/usr/bin/env zsh
|
||||||
|
|
||||||
@ -191,7 +200,6 @@ Emacs has better default values now, so it will ask to evaluate local variables.
|
|||||||
* Org-mode for a great todo list
|
* Org-mode for a great todo list
|
||||||
** Making the Agenda features more efficient
|
** Making the Agenda features more efficient
|
||||||
Using ripgrep we can automatically narrow org-agenda files.
|
Using ripgrep we can automatically narrow org-agenda files.
|
||||||
|
|
||||||
*** Finding Files with Ripgrep
|
*** Finding Files with Ripgrep
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: agenda-efficient
|
:CUSTOM_ID: agenda-efficient
|
||||||
@ -218,6 +226,15 @@ And then we want to call this before building the agenda:
|
|||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(add-hook 'org-agenda-mode-hook 'set-org-agenda-files-ripgrep)
|
(add-hook 'org-agenda-mode-hook 'set-org-agenda-files-ripgrep)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
*** Filtering the agenda
|
||||||
|
I don't want the agenda to show more than one day be default.
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(setq org-agenda-start-day "-8d")
|
||||||
|
(setq org-agenda-span 9)
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
#+RESULTS:
|
||||||
|
: 9
|
||||||
|
|
||||||
|
|
||||||
** Basic settings
|
** Basic settings
|
||||||
@ -322,18 +339,19 @@ In order for editorconfig to do its thing, indentation by the lsp must be disabl
|
|||||||
* Website
|
* Website
|
||||||
** Capture template
|
** Capture template
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(setq templates/post-capture-props "#+date: [%<%Y-%m-%d %a>]\n#+lastmod:\n#+categories[]:\n#+tags[]:\n#+images[]: ")
|
;(setq templates/post-capture-props "#+date: [%<%Y-%m-%d %a>]\n#+lastmod:\n#+categories[]:\n#+tags[]:\n#+images[]: ")
|
||||||
(setq templates/post-capture-title "#+TITLE: ${title}\n")
|
;(setq templates/post-capture-title "#+TITLE: ${title}\n")
|
||||||
(setq templates/post-capture-template (concat templates/post-capture-title templates/post-capture-props))
|
;(setq templates/post-capture-template (concat templates/post-capture-title templates/post-capture-props))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
|
(after! org-roam
|
||||||
(add-to-list 'org-roam-capture-templates
|
(add-to-list 'org-roam-capture-templates
|
||||||
'("m" "Markdown" plain "" :target
|
'("m" "Markdown" plain "" :target
|
||||||
(file+head "training-resources/content/${title}.md"
|
(file+head "training-resources/content/${title}.md"
|
||||||
"---\ntitle: ${title}\nid: %<%Y-%m-%dT%H%M%S>\ncategory: \n---\n")
|
"---\ntitle: ${title}\nid: %<%Y-%m-%dT%H%M%S>\ncategory: \n---\n")
|
||||||
:unnarrowed t))
|
:unnarrowed t)))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
|
||||||
@ -526,8 +544,35 @@ We'll want a handy shortcut for this.
|
|||||||
#+end_src
|
#+end_src
|
||||||
#+RESULTS:
|
#+RESULTS:
|
||||||
: /home/user/.config/doom/
|
: /home/user/.config/doom/
|
||||||
|
*** Delete links from inline anki
|
||||||
|
#+begin_src elisp
|
||||||
|
(defun inline-anki-link-filter (link backend info)
|
||||||
|
"Rewrite links in export to preserve link text only"
|
||||||
|
(if (eq backend 'inline-anki--ox-anki-html-backend)
|
||||||
|
(save-match-data ; is usually a good idea
|
||||||
|
(and (string-match "\\[(?:\\[([^\\]\\[]*)\\])(?:\\[(.*)\\])?\\]" link)
|
||||||
|
(match-string 2 link)))))
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
#+RESULTS:
|
||||||
|
: inline-anki-link-filter
|
||||||
|
|
||||||
|
#+begin_src elisp
|
||||||
|
(add-to-list 'org-export-filter-link-functions
|
||||||
|
'inline-anki-link-filter)
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
|
||||||
|
#+begin_src elisp
|
||||||
|
|
||||||
|
#+end_src
|
||||||
|
#+RESULTS:
|
||||||
|
| inline-anki-link-filter |
|
||||||
|
|
||||||
** Automatic Citations with *citar* and *org-cite*
|
** Automatic Citations with *citar* and *org-cite*
|
||||||
|
:PROPERTIES:
|
||||||
|
:custom_id: citation-settings
|
||||||
|
:END:
|
||||||
Citar is a sweet little package for managing citations.
|
Citar is a sweet little package for managing citations.
|
||||||
We want a general [[file:~/org/references.bib][bibliography file]], a [[file:~/Zotero/styles/][styles directory]],
|
We want a general [[file:~/org/references.bib][bibliography file]], a [[file:~/Zotero/styles/][styles directory]],
|
||||||
and a default set of styles.
|
and a default set of styles.
|
||||||
@ -674,21 +719,7 @@ Org-roam enables features essential to a Zettelkasten such as inter-ID linking.
|
|||||||
`(
|
`(
|
||||||
("d" "default" plain "%?"
|
("d" "default" plain "%?"
|
||||||
:target (file+head "%<%Y%m%d-%H%M%S>.org"
|
:target (file+head "%<%Y%m%d-%H%M%S>.org"
|
||||||
"#+TITLE: ${title}\n#+HTML_HEAD: <link rel=\"stylesheet\" type=\"text/css\" href=\"css/retro.css\" />\n")
|
"#+TITLE: ${title}\n")
|
||||||
:unnarrowed t)
|
|
||||||
|
|
||||||
("s" "school" plain "%?"
|
|
||||||
:target (file+head "%<%Y%m%d-%H%M%S>.org"
|
|
||||||
"#+TITLE: ${title}
|
|
||||||
,#+LATEX_CLASS: student-apa7
|
|
||||||
,#+LATEX_OPTIONS: stu
|
|
||||||
,#+LATEX_HEADER: \\course{}
|
|
||||||
,#+LATEX_HEADER:\\authorsnames{Judah Sotomayor}
|
|
||||||
,#+LATEX_HEADER: \\authorsaffiliations{}
|
|
||||||
,#+LATEX_HEADER: \\professor{}
|
|
||||||
,#+LATEX_HEADER: \\usepackage{times}
|
|
||||||
,#+LATEX_HEADER: \\duedate{}
|
|
||||||
,#+OPTIONS: toc:nil\n")
|
|
||||||
:unnarrowed t)
|
:unnarrowed t)
|
||||||
|
|
||||||
("c" "encrypted" plain "%?"
|
("c" "encrypted" plain "%?"
|
||||||
@ -836,7 +867,8 @@ I want to be able to ignore headings on export.
|
|||||||
(after! org
|
(after! org
|
||||||
(use-package! ox-extra
|
(use-package! ox-extra
|
||||||
:config
|
:config
|
||||||
(ox-extras-activate '(latex-header-blocks ignore-headlines))))
|
(ox-extras-activate '(latex-header-blocks ignore-headlines)
|
||||||
|
)))
|
||||||
#+end_src
|
#+end_src
|
||||||
*** Resume template
|
*** Resume template
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
|
Loading…
Reference in New Issue
Block a user