Add org-id and included images notes to Org Roam

Signed-off-by: Magic_RB <magic_rb@redalder.org>
This commit is contained in:
Magic_RB 2021-10-21 00:33:25 +02:00
parent 9770c3885a
commit 0c2b0fe8b5
No known key found for this signature in database
GPG key ID: 08D5287CC5DDCA0E

View file

@ -4,6 +4,25 @@
#+title: Org Roam
#+filetags: emacs-load
#+BEGIN_NOTE
When exporting, running ~(org-id-update-id-locations (directory-files-recursively org-roam-directory ".org"))~
#+END_NOTE
#+BEGIN_SRC emacs-lisp :tangle no :results none
(defun replace-in-string (what with in)
(replace-regexp-in-string (regexp-quote what) with in nil 'literal))
(defun org-html--format-image (source attributes info)
(progn
(setq source (replace-in-string "%20" " " source))
(format "<img src=\"data:image/%s+xml;base64,%s\"%s />"
(or (file-name-extension source) "")
(base64-encode-string
(with-temp-buffer
(insert-file-contents-literally source)
(buffer-string)))
(file-name-nondirectory source))))
#+END_SRC
#+BEGIN_QUOTE
Org-roam is a plain-text knowledge management system. It brings some of Roam's more powerful features into the Org-mode ecosystem.