notes for apim

This commit is contained in:
2026-01-17 09:08:36 +00:00
parent 3f319f8b3d
commit f797a0a768
12 changed files with 128 additions and 20 deletions

View File

@@ -25,6 +25,7 @@
(require 'seq)
(require 'cl-lib)
(setq org-export-with-broken-links t)
(setq org-id-locations-file "~/.emacs.d/.org-id-locations")
@@ -122,7 +123,6 @@
(advice-add 'org-html-template :around #'z/org-html-wrap-content-for-stack)
(add-to-list 'load-path default-directory)
(defvar z-shared-head
@@ -194,8 +194,13 @@ Created with %c on <a href=\"https://www.archlinux.org/\">Arch</a> <a href=\"htt
;; Configure LaTeX image generation
(setq org-latex-create-formula-image-program 'imagemagick)
(setq org-roam-file-exclude-regexp
(concat
"\\.sync-conflict-"
"\\|all-files\\.org$"
"\\|#"
"\\|\\.~"
"\\|<.*>$"))
(defun my/get-org-roam-backlinks (filename)
"Return backlinks for the given org-roam file. FILENAME should be the full path to the org-roam file."
@@ -236,9 +241,20 @@ Created with %c on <a href=\"https://www.archlinux.org/\">Arch</a> <a href=\"htt
(plist-get bl :link))))))))
(add-hook 'org-export-before-processing-hook
#'my/org-export-insert-backlinks)
(defun my/org-export-insert-backlinks (_backend)
"Insert Org-roam backlinks before export."
(when (and (buffer-file-name)
(not (string-match-p "all-files\\.org$" (buffer-file-name)))
(featurep 'org-roam)
(org-roam-node-at-point))
(let ((backlinks (my/get-org-roam-backlinks (buffer-file-name))))
(when backlinks
(goto-char (point-max))
(insert "\n#+ATTR_HTML: :class backlinks-section :id backlinks\n")
(insert "* Backlinks\n")
(insert "#+ATTR_HTML: :class backlinks-list\n")
(dolist (bl backlinks)
(insert (format "- %s\n" (plist-get bl :link))))))))
(setq org-id-locations-file "~/.emacs.d/.org-id-locations")
(setq org-roam-directory "~/master-folder/org_files/org_roam/")
@@ -311,7 +327,6 @@ Created with %c on <a href=\"https://www.archlinux.org/\">Arch</a> <a href=\"htt
"Full rebuild: Org, assets, and search index."
(interactive)
(setq z/build-full-rebuild t)
(org-id-update-id-locations)
(z/generate-all-files-org)
(org-publish "org-roam" t)
(org-publish "org-static" t)
@@ -326,8 +341,6 @@ Created with %c on <a href=\"https://www.archlinux.org/\">Arch</a> <a href=\"htt
(message "⚡ Fast rebuild complete (no search index)"))
(org-id-update-id-locations)
(cond
((member "--fast" command-line-args-left)
(z/build-fast))