vendor: import org-roam blog export and helpers from mac@0789326
New files, no local counterpart, taken verbatim from upstream:
qwan/org-roam-export-blog.el org-roam note -> firehose draft / jekyll draft
qwan/org-roam-export-blog-test.el 364-line ERT suite for the above
qwan/test-fixtures/vault/ vault fixture (notes + .attach tree)
mostalive/{my-org-roam,convert-chats-to-org,journelly-convert-entry-to-org-roam}.el
config-local.example.el template for gitignored config-local.el
elfeed.org, mise.toml feed list; node 24 pin (2ad9dfd)
Not imported, deliberately:
qwan/qwan-markdown-dnd.el earlier, cruder prototype of the same idea as
our firehose-blog.el: copies dropped files to a
cwd-relative dir, overwrites on name clash,
no year dirs, no tests, and evaluates an
ert-deftest at load time (upstream had to
disable it in 7153a24/e1d2415). Installing it
alongside firehose-blog.el would put two
handlers in dnd-protocol-alist for markdown
buffers. Ours supersedes it.
.devcontainer/, run-container.sh, coe-xx/, .pi/, CLAUDE.md, investigation.md
container/game-and-watch/agent scaffolding
README.org, AGENTS.md upstream's docs; ours are doom-specific
Nothing is wired up yet -- these files are inert until the next commit
requires them. Note that mostalive/my-org-roam.el shadows the `my-org-roam'
we currently load from ~/dev/emacs/org-roaming, so do not put mostalive/ on
the load-path without deciding which one wins.
This commit is contained in:
@@ -0,0 +1,72 @@
|
|||||||
|
;;; config-local.example.el --- Template for machine-specific config -*- lexical-binding: t; -*-
|
||||||
|
;;
|
||||||
|
;; Copy this file to config-local.el and uncomment/modify the section for your setup.
|
||||||
|
;; config-local.el is gitignored, so each machine can have its own configuration.
|
||||||
|
|
||||||
|
;;; ============================================================================
|
||||||
|
;;; OPTION 1: Linux with Ollama (local models)
|
||||||
|
;;; ============================================================================
|
||||||
|
|
||||||
|
;; (setq gptel-backend (gptel-make-ollama "Ollama"
|
||||||
|
;; :host "localhost:11434"
|
||||||
|
;; :stream t
|
||||||
|
;; :models '(qwen2.5-coder:7b
|
||||||
|
;; qwen3:32b
|
||||||
|
;; llama3.2:latest))
|
||||||
|
;; gptel-model 'qwen2.5-coder:7b)
|
||||||
|
;;
|
||||||
|
;; (setq-default gptel-model 'qwen2.5-coder:7b)
|
||||||
|
;;
|
||||||
|
;; (gptel-make-preset 'explain
|
||||||
|
;; :system "Explain what this code does to a novice programmer."
|
||||||
|
;; :model 'qwen2.5-coder:7b
|
||||||
|
;; :backend "Ollama")
|
||||||
|
|
||||||
|
;;; ============================================================================
|
||||||
|
;;; OPTION 2: macOS connecting to remote Linux server
|
||||||
|
;;; ============================================================================
|
||||||
|
|
||||||
|
;; (setq gptel-backend (gptel-make-openai "remote-llama"
|
||||||
|
;; :host "linux-server.local:8000" ; your server's hostname
|
||||||
|
;; :protocol "http"
|
||||||
|
;; :stream t
|
||||||
|
;; :models '(Qwen3-30B-A3B-Thinking-2507-Q6_K.gguf))
|
||||||
|
;; gptel-model 'Qwen3-30B-A3B-Thinking-2507-Q6_K.gguf)
|
||||||
|
;;
|
||||||
|
;; (setq-default gptel-model 'Qwen3-30B-A3B-Thinking-2507-Q6_K.gguf)
|
||||||
|
;;
|
||||||
|
;; (gptel-make-preset 'explain
|
||||||
|
;; :system "Explain what this code does to a novice programmer."
|
||||||
|
;; :model 'Qwen3-30B-A3B-Thinking-2507-Q6_K.gguf
|
||||||
|
;; :backend "remote-llama")
|
||||||
|
|
||||||
|
;;; ============================================================================
|
||||||
|
;;; OPTION 3: Linux with local llama.cpp server
|
||||||
|
;;; ============================================================================
|
||||||
|
|
||||||
|
;; (setq gptel-backend (gptel-make-openai "llama.cpp"
|
||||||
|
;; :host "localhost:8000"
|
||||||
|
;; :protocol "http"
|
||||||
|
;; :stream t
|
||||||
|
;; :models '(Qwen3-30B-A3B-Thinking-2507-Q6_K.gguf))
|
||||||
|
;; gptel-model 'Qwen3-30B-A3B-Thinking-2507-Q6_K.gguf)
|
||||||
|
;;
|
||||||
|
;; (setq-default gptel-model 'Qwen3-30B-A3B-Thinking-2507-Q6_K.gguf)
|
||||||
|
;;
|
||||||
|
;; ;; Also add Ollama as secondary backend
|
||||||
|
;; (gptel-make-ollama "Ollama"
|
||||||
|
;; :host "localhost:11434"
|
||||||
|
;; :stream t
|
||||||
|
;; :models '(qwen2.5-coder:7b qwen3:0.6B))
|
||||||
|
;;
|
||||||
|
;; (gptel-make-preset 'explain
|
||||||
|
;; :system "Explain what this code does to a novice programmer."
|
||||||
|
;; :model 'Qwen3-Coder-30B-A3B-Instruct-Q6_K.gguf
|
||||||
|
;; :backend "llama.cpp")
|
||||||
|
;;
|
||||||
|
;; (gptel-make-preset 'elixir
|
||||||
|
;; :system "You are an expert programmer, specialising in Elixir and TDD, you live in Emacs"
|
||||||
|
;; :model 'Qwen3-Coder-30B-A3B-Instruct-Q6_K.gguf
|
||||||
|
;; :backend "llama.cpp")
|
||||||
|
|
||||||
|
;;; config-local.example.el ends here
|
||||||
+28
@@ -0,0 +1,28 @@
|
|||||||
|
#+title: Elfeed
|
||||||
|
|
||||||
|
* Blogs :elfeed:
|
||||||
|
** entry-title: \(linux\|linus\|ubuntu\|kde\|gnome\) :linux:
|
||||||
|
** http://git-annex.branchable.com/design/assistant/blog/index.rss :mustread:
|
||||||
|
** http://feeds.feedburner.com/InformationIsBeautiful
|
||||||
|
** [[http://orgmode.org][Org Mode Links supported as well]]
|
||||||
|
** Software Development :dev:
|
||||||
|
*** Emacs :emacs:mustread:
|
||||||
|
**** http://www.terminally-incoherent.com/blog/feed
|
||||||
|
**** http://nullprogram.com/feed
|
||||||
|
**** entry-title: \(emacs\|org-mode\)
|
||||||
|
**** http://planet.emacsen.org/atom.xml
|
||||||
|
**** [[toobnix:154][EmacsConf]]
|
||||||
|
*** Web Development :web:
|
||||||
|
**** http://planet.phpunit.de/atom.xml
|
||||||
|
**** http://feeds.feedburner.com/symfony/blog
|
||||||
|
**** http://feeds.feedburner.com/qooxdoo/blog/content
|
||||||
|
*** Eclipse :eclipse:
|
||||||
|
**** http://blog.eclipse-tips.com/feeds/posts/default?alt=rss
|
||||||
|
**** http://ed-merks.blogspot.com/feeds/posts/default
|
||||||
|
A description of a feed can be written under any headline.
|
||||||
|
The text will be ignored by elfeed.
|
||||||
|
**** http://feeds.feedburner.com/eclipselive :ignore:
|
||||||
|
**** http://www.fosslc.org/drupal/rss.xml :video:
|
||||||
|
#+link: toobnix https://toobnix.org/feeds/videos.xml?videoChannelId=
|
||||||
|
|
||||||
|
** Willem
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
;;; mostalive/convert-chats-to-org.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
|
(defun chat-remove-hours-ago ()
|
||||||
|
"Format chat messages by adding '|' separator and user names."
|
||||||
|
(interactive)
|
||||||
|
(save-excursion
|
||||||
|
(goto-char (point-min))
|
||||||
|
(while (re-search-forward "[0-9]+ hours ago" nil t)
|
||||||
|
(replace-match ""))))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
(ert-deftest test-chat-remove-hours-ago ()
|
||||||
|
(should (string=
|
||||||
|
(with-temp-buffer
|
||||||
|
(insert "17 hours ago")
|
||||||
|
(goto-char (point-min))
|
||||||
|
(chat-remove-hours-ago)
|
||||||
|
(buffer-string))
|
||||||
|
"")))
|
||||||
|
|
||||||
|
(ert-deftest test-replace-hours-ago-regexp-in-string ()
|
||||||
|
(should (string=
|
||||||
|
(replace-regexp-in-string "\n\s+[0-9]+ hours ago\s*\n"
|
||||||
|
"|"
|
||||||
|
"\n 11 hours ago \n")
|
||||||
|
"|")))
|
||||||
|
|
||||||
|
(ert 'test-replace-hours-ago-regexp-in-string )
|
||||||
|
;;(ert 'test-chat-remove-hours-ago )
|
||||||
@@ -0,0 +1,97 @@
|
|||||||
|
;;; mostalive/convert-journelly-to-org-roam.el -*- lexical-binding: t; -*-
|
||||||
|
(require 'cl-lib)
|
||||||
|
|
||||||
|
(provide 'journelly-convert-entry-to-org-roam)
|
||||||
|
|
||||||
|
(cl-defstruct journelly-entry
|
||||||
|
title
|
||||||
|
content
|
||||||
|
heading
|
||||||
|
url)
|
||||||
|
|
||||||
|
(defun journelly-parse-entry (entry-text)
|
||||||
|
"Parse a journelly entry and return a journelly-entry struct."
|
||||||
|
(let* ((lines (split-string entry-text "\n" t)) ; t omits null strings
|
||||||
|
(heading (car lines))
|
||||||
|
(url-line (cl-find-if (lambda (l) (string-match-p "https?://" l)) lines))
|
||||||
|
(url-pos (cl-position url-line lines :test 'equal))
|
||||||
|
;; Title is the non-empty line before the URL
|
||||||
|
(title-line (when url-pos
|
||||||
|
(cl-find-if (lambda (l) (not (string-match-p "^[[:space:]]*$" l)))
|
||||||
|
(reverse (cl-subseq lines 0 url-pos)))))
|
||||||
|
;; Content is everything except heading, title, and URL
|
||||||
|
(content-lines (cl-remove-if (lambda (l)
|
||||||
|
(or (equal l heading)
|
||||||
|
(equal l title-line)
|
||||||
|
(equal l url-line)))
|
||||||
|
lines)))
|
||||||
|
(make-journelly-entry
|
||||||
|
:title title-line
|
||||||
|
:content (string-trim (mapconcat 'identity content-lines "\n"))
|
||||||
|
:heading heading
|
||||||
|
:url url-line)))
|
||||||
|
|
||||||
|
(defun my/journelly-add-properties (url journelly-heading)
|
||||||
|
"Add ROAM_REFS and JOURNELLY_TITLE to the current node's property drawer."
|
||||||
|
(org-with-point-at 1
|
||||||
|
(when url
|
||||||
|
(org-roam-property-add "ROAM_REFS" url))
|
||||||
|
(when journelly-heading
|
||||||
|
(org-roam-property-add "JOURNELLY_TITLE" journelly-heading))))
|
||||||
|
|
||||||
|
|
||||||
|
(defun journelly-convert-entry-to-org-roam ()
|
||||||
|
"Interactive function to convert journelly entry to org-roam.
|
||||||
|
Opens the capture buffer, adds url as ROAM_REFS
|
||||||
|
and then lets you review before finalizing."
|
||||||
|
(interactive)
|
||||||
|
(let* ((entry-text (if (use-region-p)
|
||||||
|
(buffer-substring-no-properties (region-beginning) (region-end))
|
||||||
|
(buffer-substring-no-properties (point-min) (point-max))))
|
||||||
|
(parsed (journelly-parse-entry entry-text))
|
||||||
|
(title (journelly-entry-title parsed))
|
||||||
|
(content (journelly-entry-content parsed))
|
||||||
|
(heading (journelly-entry-heading parsed))
|
||||||
|
(url (journelly-entry-url parsed))
|
||||||
|
(body (concat (or content "") "\n")))
|
||||||
|
(org-roam-capture-
|
||||||
|
:node (org-roam-node-create :title title)
|
||||||
|
:props (list :immediate-finish nil
|
||||||
|
:jump-to-captured t)
|
||||||
|
:templates `(("d" "default" plain
|
||||||
|
,body
|
||||||
|
:target (file+head "%<%Y%m%d%H%M%S>-${slug}.org"
|
||||||
|
"#+title: ${title}\n\n")
|
||||||
|
:unnarrowed t)))
|
||||||
|
(my/journelly-add-properties url heading)))
|
||||||
|
|
||||||
|
|
||||||
|
(ert-deftest test-journelly-parse-basic ()
|
||||||
|
(let* ((entry " * [2025-10-08 Wed 22:39] @ -
|
||||||
|
Paul is #XP
|
||||||
|
Do software engineering professionals still read? - survey results
|
||||||
|
https://paulgrenyer.blogspot.com/2025/10/do-software-engineering-professionals.html?m=1")
|
||||||
|
(parsed (journelly-parse-entry entry)))
|
||||||
|
(should (equal (journelly-entry-heading parsed)
|
||||||
|
" * [2025-10-08 Wed 22:39] @ -"))
|
||||||
|
(should (equal (journelly-entry-title parsed)
|
||||||
|
"Do software engineering professionals still read? - survey results"))
|
||||||
|
(should (equal (journelly-entry-url parsed)
|
||||||
|
"https://paulgrenyer.blogspot.com/2025/10/do-software-engineering-professionals.html?m=1"))
|
||||||
|
(should (equal (journelly-entry-content parsed)
|
||||||
|
"Paul is #XP"))))
|
||||||
|
|
||||||
|
(ert-deftest test-journelly-parse-with-extra-text-after-url ()
|
||||||
|
(let* ((entry " * [2025-10-08 Wed 22:39] @ -
|
||||||
|
Some intro text
|
||||||
|
Article Title
|
||||||
|
https://example.com
|
||||||
|
Some notes after the URL")
|
||||||
|
(parsed (journelly-parse-entry entry)))
|
||||||
|
(should (equal (journelly-entry-title parsed) "Article Title"))
|
||||||
|
(should (equal (journelly-entry-url parsed) "https://example.com"))
|
||||||
|
(should (string-match-p "Some intro text" (journelly-entry-content parsed)))
|
||||||
|
(should (string-match-p "Some notes after the URL" (journelly-entry-content parsed)))))
|
||||||
|
|
||||||
|
|
||||||
|
;; Run tests manually with: (ert "test-journelly-*")
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
;;; mostalive/my-org-roam.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
|
(provide 'my-org-roam)
|
||||||
|
;; Insert a link to a node, don't go to buffer when the node is new.
|
||||||
|
(defun org-roam-node-insert-immediate (arg &rest args)
|
||||||
|
(interactive "P")
|
||||||
|
(let ((args (push arg args))
|
||||||
|
(org-roam-capture-templates
|
||||||
|
(list
|
||||||
|
(append (car org-roam-capture-templates) '(:immediate-finish t)))))
|
||||||
|
(apply #'org-roam-node-insert args)))
|
||||||
|
|
||||||
|
|
||||||
|
;; make sure that org-timer works and org-pomodoro therefore. Limit the number of agenda files searched
|
||||||
|
;; plus a utility function for flattening, since that is not part of the standard library of emacs
|
||||||
|
|
||||||
|
(defun org-roam-collect-org-agenda-files ()
|
||||||
|
(interactive)
|
||||||
|
(setq org-agenda-files (collect-org-agenda-files-)))
|
||||||
|
|
||||||
|
(defun collect-org-agenda-files- ()
|
||||||
|
(seq-map
|
||||||
|
'car
|
||||||
|
(org-roam-db-query
|
||||||
|
[:select
|
||||||
|
[file]
|
||||||
|
:from files
|
||||||
|
:where (like file "%daily\/2023%")
|
||||||
|
:order-by (desc file)
|
||||||
|
:limit 20])))
|
||||||
|
|
||||||
|
(setq org-agenda-files (collect-org-agenda-files-))
|
||||||
|
|
||||||
|
|
||||||
|
(defun open-today-log ()
|
||||||
|
"Open today's log file in log/YYYY-MM-DD.md format.
|
||||||
|
Creates the log directory if it doesn't exist."
|
||||||
|
(interactive)
|
||||||
|
(let* ((git-root (locate-dominating-file "." ".git"))
|
||||||
|
(log-dir (concat git-root "log"))
|
||||||
|
(date-str (format-time-string "%Y-%m-%d")))
|
||||||
|
(unless (file-directory-p log-dir)
|
||||||
|
(make-directory log-dir t))
|
||||||
|
(let ((file-name (concat log-dir "/" date-str ".org")))
|
||||||
|
(if (file-exists-p file-name)
|
||||||
|
(find-file file-name)
|
||||||
|
(progn (find-file file-name)
|
||||||
|
(insert (format "# %s\n\n" date-str)))))))
|
||||||
@@ -0,0 +1,364 @@
|
|||||||
|
;;; org-roam-export-blog-test.el --- ERT tests for org-roam-export-blog -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
|
;;; Commentary:
|
||||||
|
|
||||||
|
;; Run with:
|
||||||
|
;; emacs --batch -Q -l org -l ox-md -L ~/.doom.d/qwan \
|
||||||
|
;; -l org-roam-export-blog.el -l org-roam-export-blog-test.el \
|
||||||
|
;; -f ert-run-tests-batch-and-exit
|
||||||
|
;;
|
||||||
|
;; Tests use a fixture vault under test-fixtures/vault and write output into
|
||||||
|
;; throw-away firehose/jekyll repo skeletons under /tmp.
|
||||||
|
|
||||||
|
;;; Code:
|
||||||
|
|
||||||
|
(require 'ert)
|
||||||
|
(require 'org-roam-export-blog)
|
||||||
|
|
||||||
|
(defconst roeb-test-dir
|
||||||
|
(directory-file-name (file-name-directory (or load-file-name default-directory))))
|
||||||
|
|
||||||
|
(defconst roeb-test-vault (expand-file-name "test-fixtures/vault" roeb-test-dir))
|
||||||
|
|
||||||
|
(defun roeb-test--file (name)
|
||||||
|
"Path to fixture file NAME in the test vault."
|
||||||
|
(expand-file-name name roeb-test-vault))
|
||||||
|
|
||||||
|
(defun roeb-test--new-firehose-root ()
|
||||||
|
"Create a throw-away firehose repo skeleton and return its root."
|
||||||
|
(let ((root (make-temp-file "/tmp/roeb-firehose-" t)))
|
||||||
|
(make-directory (expand-file-name "app/priv/blog/engineering" root) t)
|
||||||
|
(make-directory (expand-file-name "app/priv/static/images/blog" root) t)
|
||||||
|
root))
|
||||||
|
|
||||||
|
(defun roeb-test--new-jekyll-root ()
|
||||||
|
"Create a throw-away jekyll site skeleton and return its root."
|
||||||
|
(let ((root (make-temp-file "/tmp/roeb-jekyll-" t)))
|
||||||
|
(make-directory (expand-file-name "_drafts" root) t)
|
||||||
|
(make-directory (expand-file-name "attachments/blogposts" root) t)
|
||||||
|
root))
|
||||||
|
|
||||||
|
(defun roeb-test--setup-org-id ()
|
||||||
|
"Point org-id at a writable temp locations file and index the fixture vault."
|
||||||
|
(setq org-id-locations-file (make-temp-file "/tmp/roeb-orgid-"))
|
||||||
|
(setq org-id-locations nil)
|
||||||
|
(org-id-update-id-locations
|
||||||
|
(mapcar #'roeb-test--file '("note.org" "jev.org" "laya.org" "notitle.org")) t))
|
||||||
|
|
||||||
|
(defmacro roeb-test--with-export (firehose-root jekyll-root &rest body)
|
||||||
|
"Run BODY with the given roots and a pinned export date."
|
||||||
|
(declare (indent 2))
|
||||||
|
`(progn
|
||||||
|
(roeb-test--setup-org-id)
|
||||||
|
(let ((org-roam-export-blog-firehose-root ,firehose-root)
|
||||||
|
(org-roam-export-jekyll-root ,jekyll-root)
|
||||||
|
(org-roam-export-blog--current-date '("2026" "10" "08")))
|
||||||
|
,@body)))
|
||||||
|
|
||||||
|
(defun roeb-test--filetags-of (filetags-line)
|
||||||
|
"Write a one-keyword org file to /tmp and return its parsed filetags."
|
||||||
|
(let ((file (make-temp-file "roeb-filetags-" nil ".org")))
|
||||||
|
(unwind-protect
|
||||||
|
(progn
|
||||||
|
(with-temp-file file
|
||||||
|
(insert "#+title: T\n" (or filetags-line "") "\n"))
|
||||||
|
(org-roam-export-blog--filetags (find-file-noselect file)))
|
||||||
|
(delete-file file))))
|
||||||
|
|
||||||
|
;;; Pure helpers
|
||||||
|
|
||||||
|
(ert-deftest org-roam-export-blog/slug ()
|
||||||
|
(should (equal "will-it-blend" (org-roam-export-blog--slug "Will It Blend")))
|
||||||
|
(should (equal "improve-diagnostic-in-the-tdd-cycle"
|
||||||
|
(org-roam-export-blog--slug "Improve Diagnostic in the TDD cycle")))
|
||||||
|
(should (equal "v0-2-0-rss-subscribe-links"
|
||||||
|
(org-roam-export-blog--slug "v0.2.0 — RSS Subscribe Links"))))
|
||||||
|
|
||||||
|
(ert-deftest org-roam-export-blog/truncate-description-short ()
|
||||||
|
(should (equal "Short paragraph."
|
||||||
|
(org-roam-export-blog--truncate-description "Short paragraph."))))
|
||||||
|
|
||||||
|
(ert-deftest org-roam-export-blog/truncate-description-at-word-boundary ()
|
||||||
|
(let* ((words (make-list 60 "word"))
|
||||||
|
(text (string-join words " "))
|
||||||
|
(result (org-roam-export-blog--truncate-description text)))
|
||||||
|
(should (<= (length result) (+ org-roam-export-blog-description-length 1)))
|
||||||
|
(should (string-suffix-p "…" result))
|
||||||
|
(should-not (string-suffix-p " " result))
|
||||||
|
(should (string-prefix-p "word word" result))))
|
||||||
|
|
||||||
|
;;; Filetags
|
||||||
|
|
||||||
|
(ert-deftest org-roam-export-blog/filetags-colon-syntax ()
|
||||||
|
(should (equal '("writing" "blender")
|
||||||
|
(roeb-test--filetags-of "#+filetags: :writing:blender:"))))
|
||||||
|
|
||||||
|
(ert-deftest org-roam-export-blog/filetags-bracket-syntax ()
|
||||||
|
(should (equal '("writing" "blender")
|
||||||
|
(roeb-test--filetags-of "#+filetags: [writing blender]"))))
|
||||||
|
|
||||||
|
(ert-deftest org-roam-export-blog/filetags-absent ()
|
||||||
|
(should (null (roeb-test--filetags-of nil))))
|
||||||
|
|
||||||
|
;;; Targets and configuration
|
||||||
|
|
||||||
|
(ert-deftest org-roam-export-blog/firehose-target-requires-root ()
|
||||||
|
(let ((org-roam-export-blog-firehose-root nil))
|
||||||
|
(should-error (org-roam-export-blog--firehose-target) :type 'user-error)))
|
||||||
|
|
||||||
|
(ert-deftest org-roam-export-blog/jekyll-target-requires-root ()
|
||||||
|
(let ((org-roam-export-jekyll-root nil))
|
||||||
|
(should-error (org-roam-export-blog--jekyll-target) :type 'user-error)))
|
||||||
|
|
||||||
|
(ert-deftest org-roam-export-blog/target-requires-existing-root ()
|
||||||
|
"A configured but absent root must fail loudly, not create a stray tree."
|
||||||
|
(let ((org-roam-export-blog-firehose-root "/tmp/roeb-does-not-exist"))
|
||||||
|
(should-error (org-roam-export-blog--firehose-target) :type 'user-error)))
|
||||||
|
|
||||||
|
;;; Roam ref resolution
|
||||||
|
|
||||||
|
(ert-deftest org-roam-export-blog/roam-refs ()
|
||||||
|
(roeb-test--setup-org-id)
|
||||||
|
(should (equal "https://example.com/jev"
|
||||||
|
(org-roam-export-blog--roam-refs (roeb-test--file "jev.org"))))
|
||||||
|
(should (null (org-roam-export-blog--roam-refs (roeb-test--file "laya.org")))))
|
||||||
|
|
||||||
|
;;; Aborts
|
||||||
|
|
||||||
|
(ert-deftest org-roam-export-blog/no-title-aborts ()
|
||||||
|
(let ((root (roeb-test--new-firehose-root)))
|
||||||
|
(roeb-test--with-export root nil
|
||||||
|
(should-error (org-roam-export-blog--export-file
|
||||||
|
(org-roam-export-blog--firehose-target)
|
||||||
|
(roeb-test--file "notitle.org"))
|
||||||
|
:type 'user-error)
|
||||||
|
;; Aborting must not have written any posts.
|
||||||
|
(should (null
|
||||||
|
(directory-files-recursively
|
||||||
|
(expand-file-name "app/priv/blog" root) "\\.md$"))))))
|
||||||
|
|
||||||
|
(ert-deftest org-roam-export-blog/filename-collision-aborts ()
|
||||||
|
(let ((root (roeb-test--new-firehose-root)))
|
||||||
|
(roeb-test--with-export root nil
|
||||||
|
;; Pre-create the exact target file.
|
||||||
|
(make-directory
|
||||||
|
(expand-file-name "app/priv/blog/engineering/2026" root) t)
|
||||||
|
(write-region "" nil
|
||||||
|
(expand-file-name
|
||||||
|
"app/priv/blog/engineering/2026/10-08-will-it-blend.md" root))
|
||||||
|
(should-error (org-roam-export-blog--export-file
|
||||||
|
(org-roam-export-blog--firehose-target)
|
||||||
|
(roeb-test--file "note.org"))
|
||||||
|
:type 'user-error)
|
||||||
|
;; Aborting must not have copied any images (no side effects).
|
||||||
|
(should (null
|
||||||
|
(directory-files-recursively
|
||||||
|
(expand-file-name "app/priv/static/images/blog" root)
|
||||||
|
"."))))))
|
||||||
|
|
||||||
|
(ert-deftest org-roam-export-blog/jekyll-filename-collision-aborts ()
|
||||||
|
(let ((root (roeb-test--new-jekyll-root)))
|
||||||
|
(roeb-test--with-export nil root
|
||||||
|
;; Pre-create the exact target file.
|
||||||
|
(write-region "" nil
|
||||||
|
(expand-file-name "_drafts/will-it-blend.md" root))
|
||||||
|
(should-error (org-roam-export-blog--export-file
|
||||||
|
(org-roam-export-blog--jekyll-target)
|
||||||
|
(roeb-test--file "note.org"))
|
||||||
|
:type 'user-error)
|
||||||
|
;; Aborting must not have copied any images (no side effects).
|
||||||
|
(should (null
|
||||||
|
(directory-files-recursively
|
||||||
|
(expand-file-name "attachments" root)
|
||||||
|
"."))))))
|
||||||
|
|
||||||
|
;;; Full export: firehose
|
||||||
|
|
||||||
|
(ert-deftest org-roam-export-blog/end-to-end ()
|
||||||
|
(let ((root (roeb-test--new-firehose-root))
|
||||||
|
result path body)
|
||||||
|
(roeb-test--with-export root nil
|
||||||
|
(setq result (org-roam-export-blog--export-file
|
||||||
|
(org-roam-export-blog--firehose-target)
|
||||||
|
(roeb-test--file "note.org"))))
|
||||||
|
(setq path (car result))
|
||||||
|
;; Written at the agreed path.
|
||||||
|
(should (equal (expand-file-name
|
||||||
|
"app/priv/blog/engineering/2026/10-08-will-it-blend.md" root)
|
||||||
|
path))
|
||||||
|
(should (file-exists-p path))
|
||||||
|
;; Image attachment copied into static images with unchanged content.
|
||||||
|
(let ((image (expand-file-name "app/priv/static/images/blog/2026/will-it-blend.svg" root)))
|
||||||
|
(should (file-exists-p image))
|
||||||
|
(should (equal (with-temp-buffer (insert-file-contents image) (buffer-string))
|
||||||
|
(with-temp-buffer
|
||||||
|
(insert-file-contents (roeb-test--file ".attach/00/000000-0000-0000-0000-000000000001/will-it-blend.svg"))
|
||||||
|
(buffer-string)))))
|
||||||
|
(setq body (with-temp-buffer (insert-file-contents path) (buffer-string)))
|
||||||
|
;; Frontmatter.
|
||||||
|
(should (string-match-p "title: \"Will It Blend\"" body))
|
||||||
|
(should (string-match-p "author: \"Willem van den Ende\"" body))
|
||||||
|
(should (string-match-p "tags: ~w()" body))
|
||||||
|
(should (string-match-p
|
||||||
|
"description: \"Will it Blend was a series of videos promoting a blender brand.\""
|
||||||
|
body))
|
||||||
|
(should (string-match-p "image: \"/images/blog/2026/will-it-blend.svg\"" body))
|
||||||
|
(should (string-match-p "published: false" body))
|
||||||
|
;; Markdown body.
|
||||||
|
(should (string-match-p "Will it Blend was a series of videos promoting a blender brand." body))
|
||||||
|
(should (string-match-p
|
||||||
|
(regexp-quote "")
|
||||||
|
body))
|
||||||
|
(should (string-match-p (regexp-quote "[Jev](https://example.com/jev)") body))
|
||||||
|
(should (string-match-p "Laya popped up" body))
|
||||||
|
(should (string-match-p "a missing note vanished" body))
|
||||||
|
(should (string-match-p "TODO source needed (LinkedIn)" body))
|
||||||
|
(should (string-match-p "^## I learnt this from Julia$" body))
|
||||||
|
(should (string-match-p "^> A quoted comment.$" body))
|
||||||
|
(should (string-match-p "^```elixir$" body))
|
||||||
|
(should (string-match-p (regexp-quote "**bold**") body))
|
||||||
|
;; Org syntax must not leak into the markdown.
|
||||||
|
(should-not (string-match-p "#\\+begin" body))
|
||||||
|
(should-not (string-match-p "attachment:" body))
|
||||||
|
(should-not (string-match-p "id:0000" body))
|
||||||
|
(should-not (string-match-p "A private comment that must not be exported" body))
|
||||||
|
;; Warnings: dangling ref, ref without ROAM_REFS, ignored non-image
|
||||||
|
;; attachment.
|
||||||
|
(should (= 3 (length (cdr result))))
|
||||||
|
(should (cl-some (lambda (w) (string-match-p "00000000-0000-0000-0000-000000009999" w))
|
||||||
|
(cdr result)))
|
||||||
|
(should (cl-some (lambda (w) (string-match-p "00000000-0000-0000-0000-000000000003" w))
|
||||||
|
(cdr result)))
|
||||||
|
(should (cl-some (lambda (w) (string-match-p "attached-notes.txt" w))
|
||||||
|
(cdr result)))))
|
||||||
|
|
||||||
|
(ert-deftest org-roam-export-blog/description-truncated-in-frontmatter ()
|
||||||
|
(let* ((root (roeb-test--new-firehose-root))
|
||||||
|
(vault (make-temp-file "/tmp/roeb-vault-" t))
|
||||||
|
(note (expand-file-name "longpar.org" vault))
|
||||||
|
(long-text (string-join (make-list 50 "lorem" ) " ")))
|
||||||
|
(with-temp-file note
|
||||||
|
(insert ":PROPERTIES:\n:ID: 00000000-0000-0000-0000-000000000005\n:END:\n"
|
||||||
|
"#+title: Long Paragraph\n\n" long-text "\n"))
|
||||||
|
(roeb-test--with-export root nil
|
||||||
|
(let ((result (org-roam-export-blog--export-file
|
||||||
|
(org-roam-export-blog--firehose-target) note)))
|
||||||
|
(let ((body (with-temp-buffer
|
||||||
|
(insert-file-contents (car result))
|
||||||
|
(buffer-string))))
|
||||||
|
(string-match "description: \"\\([^\"]*\\)\"" body)
|
||||||
|
(let ((desc (match-string 1 body)))
|
||||||
|
(should (<= (length desc) (+ org-roam-export-blog-description-length 1)))
|
||||||
|
(should (string-suffix-p "…" desc))
|
||||||
|
(should (string-prefix-p "lorem lorem" desc))))))))
|
||||||
|
|
||||||
|
(ert-deftest org-roam-export-blog/elixir-frontmatter-escapes-quotes-once ()
|
||||||
|
"Quotes in title/description must produce valid Elixir string literals.
|
||||||
|
|
||||||
|
Regression test: the old escape-then-%S combination double-escaped,
|
||||||
|
so a title containing a quote mark came out with literal
|
||||||
|
backslash-quote sequences in the exported post."
|
||||||
|
(let* ((root (roeb-test--new-firehose-root))
|
||||||
|
(vault (make-temp-file "/tmp/roeb-vault-" t))
|
||||||
|
(note (expand-file-name "quoted.org" vault)))
|
||||||
|
(with-temp-file note
|
||||||
|
(insert ":PROPERTIES:\n:ID: 00000000-0000-0000-0000-000000000007\n:END:\n"
|
||||||
|
"#+title: Say \"hi\"\n\n"
|
||||||
|
"A \"quoted\" remark.\n"))
|
||||||
|
(roeb-test--with-export root nil
|
||||||
|
(let* ((result (org-roam-export-blog--export-file
|
||||||
|
(org-roam-export-blog--firehose-target) note))
|
||||||
|
(body (with-temp-buffer
|
||||||
|
(insert-file-contents (car result))
|
||||||
|
(buffer-string))))
|
||||||
|
(should (string-match-p (regexp-quote "title: \"Say \\\"hi\\\"\",") body))
|
||||||
|
(should (string-match-p (regexp-quote
|
||||||
|
"description: \"A \\\"quoted\\\" remark.\",")
|
||||||
|
body))))))
|
||||||
|
|
||||||
|
;;; Full export: jekyll
|
||||||
|
|
||||||
|
(ert-deftest org-roam-export-blog/jekyll-end-to-end ()
|
||||||
|
(let ((root (roeb-test--new-jekyll-root))
|
||||||
|
result path body)
|
||||||
|
(roeb-test--with-export nil root
|
||||||
|
(setq result (org-roam-export-blog--export-file
|
||||||
|
(org-roam-export-blog--jekyll-target)
|
||||||
|
(roeb-test--file "note.org"))))
|
||||||
|
(setq path (car result))
|
||||||
|
;; Drafts live in _drafts, without a date prefix.
|
||||||
|
(should (equal (expand-file-name "_drafts/will-it-blend.md" root) path))
|
||||||
|
(should (file-exists-p path))
|
||||||
|
;; Image attachment copied into the site's attachments tree.
|
||||||
|
(let ((image (expand-file-name "attachments/blogposts/2026/will-it-blend.svg" root)))
|
||||||
|
(should (file-exists-p image))
|
||||||
|
(should (equal (with-temp-buffer (insert-file-contents image) (buffer-string))
|
||||||
|
(with-temp-buffer
|
||||||
|
(insert-file-contents (roeb-test--file ".attach/00/000000-0000-0000-0000-000000000001/will-it-blend.svg"))
|
||||||
|
(buffer-string)))))
|
||||||
|
(setq body (with-temp-buffer (insert-file-contents path) (buffer-string)))
|
||||||
|
;; YAML frontmatter, tags from #+filetags:.
|
||||||
|
(should (string-match-p "^---$" body))
|
||||||
|
(should (string-match-p "^layout: post$" body))
|
||||||
|
(should (string-match-p "^title: \"Will It Blend\"$" body))
|
||||||
|
(should (string-match-p "^tags:$" body))
|
||||||
|
(should (string-match-p "^ - writing$" body))
|
||||||
|
(should (string-match-p "^ - blender$" body))
|
||||||
|
(should (string-match-p "^author: \"Willem van den Ende\"$" body))
|
||||||
|
(should (string-match-p "^image: /attachments/blogposts/2026/will-it-blend.svg$" body))
|
||||||
|
;; Jekyll posts carry no description key.
|
||||||
|
(should-not (string-match-p "description:" body))
|
||||||
|
;; Markdown body.
|
||||||
|
(should (string-match-p
|
||||||
|
(regexp-quote "")
|
||||||
|
body))
|
||||||
|
(should (string-match-p (regexp-quote "[Jev](https://example.com/jev)") body))
|
||||||
|
(should (string-match-p "Laya popped up" body))
|
||||||
|
(should (string-match-p "^## I learnt this from Julia$" body))
|
||||||
|
(should (string-match-p "^```elixir$" body))
|
||||||
|
;; Org syntax must not leak into the markdown.
|
||||||
|
(should-not (string-match-p "#\\+begin" body))
|
||||||
|
(should-not (string-match-p "attachment:" body))
|
||||||
|
(should-not (string-match-p "id:0000" body))
|
||||||
|
;; Same warnings as the firehose target for the same note.
|
||||||
|
(should (= 3 (length (cdr result))))))
|
||||||
|
|
||||||
|
(ert-deftest org-roam-export-blog/jekyll-untagged-note-gets-empty-tags ()
|
||||||
|
(let* ((root (roeb-test--new-jekyll-root))
|
||||||
|
(vault (make-temp-file "/tmp/roeb-vault-" t))
|
||||||
|
(note (expand-file-name "untagged.org" vault)))
|
||||||
|
(with-temp-file note
|
||||||
|
(insert "#+title: Untagged Note\n\nFirst paragraph.\n"))
|
||||||
|
(roeb-test--with-export nil root
|
||||||
|
(let* ((result (org-roam-export-blog--export-file
|
||||||
|
(org-roam-export-blog--jekyll-target) note))
|
||||||
|
(body (with-temp-buffer
|
||||||
|
(insert-file-contents (car result))
|
||||||
|
(buffer-string))))
|
||||||
|
(should (string-match-p "^tags: \\[\\]$" body))
|
||||||
|
(should (string-match-p "^image: $" body))))))
|
||||||
|
|
||||||
|
(ert-deftest org-roam-export-blog/run-opens-the-generated-post ()
|
||||||
|
(let ((root (roeb-test--new-jekyll-root)))
|
||||||
|
(roeb-test--with-export nil root
|
||||||
|
(with-current-buffer (find-file-noselect (roeb-test--file "note.org"))
|
||||||
|
(org-roam-export-blog--run (org-roam-export-blog--jekyll-target)))
|
||||||
|
(should (get-file-buffer
|
||||||
|
(expand-file-name "_drafts/will-it-blend.md" root))))))
|
||||||
|
|
||||||
|
(ert-deftest org-roam-export-blog/jekyll-frontmatter-shape ()
|
||||||
|
(let ((org-roam-export-blog-author "Willem"))
|
||||||
|
(should (equal
|
||||||
|
(concat "---\n"
|
||||||
|
"layout: post\n"
|
||||||
|
"title: \"Say \\\"hi\\\"\"\n"
|
||||||
|
"tags:\n"
|
||||||
|
" - a\n"
|
||||||
|
" - b\n"
|
||||||
|
"author: \"Willem\"\n"
|
||||||
|
"image: \n"
|
||||||
|
"---\n")
|
||||||
|
(org-roam-export-blog--jekyll-frontmatter "Say \"hi\"" nil '("a" "b") nil)))))
|
||||||
|
|
||||||
|
(provide 'org-roam-export-blog-test)
|
||||||
|
;;; org-roam-export-blog-test.el ends here
|
||||||
@@ -0,0 +1,583 @@
|
|||||||
|
;;; org-roam-export-blog.el --- Export org-roam notes as blog posts -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
|
;;; Commentary:
|
||||||
|
|
||||||
|
;; M-x org-roam-export-blog, run from an org-roam note, converts the note to
|
||||||
|
;; markdown and writes it directly into the firehose repo as a draft post:
|
||||||
|
;;
|
||||||
|
;; <root>/app/priv/blog/engineering/<YYYY>/<MM>-<DD>-<slug>.md
|
||||||
|
;;
|
||||||
|
;; with `published: false' frontmatter, so the repo's git diff acts as the
|
||||||
|
;; review mechanism.
|
||||||
|
;;
|
||||||
|
;; M-x org-roam-export-jekyll writes the same note as a jekyll draft:
|
||||||
|
;;
|
||||||
|
;; <root>/_drafts/<slug>.md
|
||||||
|
;;
|
||||||
|
;; with YAML frontmatter (layout, title, tags from #+filetags:, author,
|
||||||
|
;; image), ready to be moved into _posts/ by the usual publishing script.
|
||||||
|
;;
|
||||||
|
;; Both targets share one pipeline; each contributes its own frontmatter,
|
||||||
|
;; post path and image convention:
|
||||||
|
;;
|
||||||
|
;; - firehose images are copied into app/priv/static/images/blog/<YYYY>/ and
|
||||||
|
;; referenced with the /images/blog/... web path.
|
||||||
|
;; - jekyll images are copied into attachments/blogposts/<YYYY>/ and
|
||||||
|
;; referenced with the /attachments/blogposts/... web path.
|
||||||
|
;;
|
||||||
|
;; What happens during export:
|
||||||
|
;;
|
||||||
|
;; - `[[id:<uuid>][text]]' roam refs are resolved via org-id. When the
|
||||||
|
;; target note carries a :ROAM_REFS: property, the link becomes a
|
||||||
|
;; markdown link to the first URL; otherwise it degrades to plain text.
|
||||||
|
;; - `[[attachment:...]]' links are resolved via the org-attach ID scheme
|
||||||
|
;; (.attach/<xx>/<rest-of-id>/<file>). Images are copied into the
|
||||||
|
;; target's image directory; non-image attachments are ignored.
|
||||||
|
;; - Org syntax is converted to markdown with a derived ox-md backend
|
||||||
|
;; (fenced code blocks with language, H2 top-level headings, no TOC).
|
||||||
|
;; - Dropped refs, ignored attachments and unhandled constructs are
|
||||||
|
;; reported as warnings.
|
||||||
|
;; - The generated post is opened in another window for review.
|
||||||
|
|
||||||
|
;;; Code:
|
||||||
|
|
||||||
|
(require 'org)
|
||||||
|
(require 'ox-md)
|
||||||
|
(require 'org-id)
|
||||||
|
(require 'cl-lib)
|
||||||
|
|
||||||
|
(defgroup org-roam-export-blog nil
|
||||||
|
"Export org-roam notes as blog posts (firehose, jekyll)."
|
||||||
|
:group 'org)
|
||||||
|
|
||||||
|
(defcustom org-roam-export-blog-firehose-root nil
|
||||||
|
"Path to the firehose repository root, e.g. \"~/dev/elixir/firehose\"."
|
||||||
|
:type '(choice (const nil) directory))
|
||||||
|
|
||||||
|
(defcustom org-roam-export-jekyll-root nil
|
||||||
|
"Path to the jekyll site repository root, e.g.
|
||||||
|
\"~/MyDocuments/qwan/sites/qwaneu.github.io\"."
|
||||||
|
:type '(choice (const nil) directory))
|
||||||
|
|
||||||
|
(defcustom org-roam-export-blog-author "Willem van den Ende"
|
||||||
|
"Author name written into generated frontmatter."
|
||||||
|
:type 'string)
|
||||||
|
|
||||||
|
(defcustom org-roam-export-blog-description-length 200
|
||||||
|
"Maximum length of the generated description (before the ellipsis)."
|
||||||
|
:type 'integer)
|
||||||
|
|
||||||
|
(defcustom org-roam-export-blog-image-extensions
|
||||||
|
'("svg" "png" "jpg" "jpeg" "gif" "webp" "avif")
|
||||||
|
"Attachment extensions that count as images."
|
||||||
|
:type '(repeat string))
|
||||||
|
|
||||||
|
(defvar org-roam-export-blog--current-date nil
|
||||||
|
"Override for the export date during tests, as a list (YEAR MONTH DAY).")
|
||||||
|
|
||||||
|
;;; Derived markdown backend
|
||||||
|
|
||||||
|
(defun org-roam-export-blog-md-src-block (src-block _contents info)
|
||||||
|
"Transcode SRC-BLOCK into a fenced markdown code block with language."
|
||||||
|
(let ((lang (org-element-property :language src-block))
|
||||||
|
(value (org-export-format-code-default src-block info)))
|
||||||
|
(concat "```" (or lang "") "\n" value "```")))
|
||||||
|
|
||||||
|
(defun org-roam-export-blog-md-link (link desc info)
|
||||||
|
"Transcode LINK; file links to images become markdown images.
|
||||||
|
|
||||||
|
Everything else is delegated to `org-md-link'."
|
||||||
|
(let* ((type (org-element-property :type link))
|
||||||
|
(path (org-element-property :path link)))
|
||||||
|
(if (and (equal type "file") (org-roam-export-blog--image-p path))
|
||||||
|
(format ""
|
||||||
|
(or (and desc (string-trim (substring-no-properties desc)))
|
||||||
|
(file-name-base path))
|
||||||
|
path)
|
||||||
|
(org-md-link link desc info))))
|
||||||
|
|
||||||
|
(org-export-define-derived-backend 'org-roam-export-blog-md 'md
|
||||||
|
:translate-alist '((src-block . org-roam-export-blog-md-src-block)
|
||||||
|
(link . org-roam-export-blog-md-link)))
|
||||||
|
|
||||||
|
(defconst org-roam-export-blog--export-options
|
||||||
|
'(:with-toc nil :section-numbers nil :md-toplevel-hlevel 2))
|
||||||
|
|
||||||
|
;;; Small helpers
|
||||||
|
|
||||||
|
(defun org-roam-export-blog--slug (title)
|
||||||
|
"Derive a filename slug from TITLE."
|
||||||
|
(let* ((lower (downcase title))
|
||||||
|
(slugged (replace-regexp-in-string "[^a-z0-9]+" "-" lower)))
|
||||||
|
(replace-regexp-in-string "\\`-+\\|-+\\'" "" slugged)))
|
||||||
|
|
||||||
|
(defun org-roam-export-blog--date-parts ()
|
||||||
|
"Export date as a list of strings (YEAR MONTH DAY)."
|
||||||
|
(or org-roam-export-blog--current-date
|
||||||
|
(list (format-time-string "%Y")
|
||||||
|
(format-time-string "%m")
|
||||||
|
(format-time-string "%d"))))
|
||||||
|
|
||||||
|
(defun org-roam-export-blog--yaml-string (text)
|
||||||
|
"Return TEXT as a double-quoted YAML scalar."
|
||||||
|
(concat "\""
|
||||||
|
(replace-regexp-in-string
|
||||||
|
"\"" "\\\\\""
|
||||||
|
(replace-regexp-in-string "\\\\" "\\\\\\\\" text))
|
||||||
|
"\""))
|
||||||
|
|
||||||
|
(defun org-roam-export-blog--yaml-tags (tags)
|
||||||
|
"Return TAGS as the body of a jekyll frontmatter tags entry."
|
||||||
|
(if tags
|
||||||
|
(concat "tags:\n"
|
||||||
|
(mapconcat (lambda (tag) (format " - %s\n" tag)) tags ""))
|
||||||
|
"tags: []\n"))
|
||||||
|
|
||||||
|
(defun org-roam-export-blog--truncate-description (text)
|
||||||
|
"Truncate TEXT to about `org-roam-export-blog-description-length' characters."
|
||||||
|
(let ((max org-roam-export-blog-description-length))
|
||||||
|
(if (<= (length text) max)
|
||||||
|
text
|
||||||
|
(let ((cut (cl-position ?\s (substring text 0 max) :from-end t)))
|
||||||
|
(concat (if cut (substring text 0 cut) (substring text 0 max))
|
||||||
|
"…")))))
|
||||||
|
|
||||||
|
(defun org-roam-export-blog--plain-text (element)
|
||||||
|
"Return a plain-text approximation of org ELEMENT."
|
||||||
|
(cond
|
||||||
|
((stringp element) element)
|
||||||
|
((memq (org-element-type element) '(code verbatim inline-src-block))
|
||||||
|
(or (org-element-property :value element) ""))
|
||||||
|
((eq (org-element-type element) 'entity)
|
||||||
|
(or (org-element-property :utf8 element) ""))
|
||||||
|
(t (mapconcat #'org-roam-export-blog--plain-text (org-element-contents element) ""))))
|
||||||
|
|
||||||
|
;;; Reading the note
|
||||||
|
|
||||||
|
(defun org-roam-export-blog--title (buffer)
|
||||||
|
"Return the #+TITLE: keyword value in BUFFER, or nil."
|
||||||
|
(with-current-buffer buffer
|
||||||
|
(cadr (assoc "TITLE" (org-collect-keywords '("TITLE"))))))
|
||||||
|
|
||||||
|
(defun org-roam-export-blog--filetags (buffer)
|
||||||
|
"Return the tags of BUFFER's #+filetags: keyword, or nil.
|
||||||
|
|
||||||
|
Accepts both org tag syntaxes: colon style (:a:b:) and bracket
|
||||||
|
style ([a b])."
|
||||||
|
(with-current-buffer buffer
|
||||||
|
(let ((value (cadr (assoc "FILETAGS" (org-collect-keywords '("FILETAGS"))))))
|
||||||
|
(when value
|
||||||
|
(let ((trimmed (string-trim value)))
|
||||||
|
(cond
|
||||||
|
((string-prefix-p "[" trimmed)
|
||||||
|
(split-string
|
||||||
|
(string-trim-left (string-trim-right trimmed "\\]") "\\[")
|
||||||
|
"[ \t]+" t))
|
||||||
|
(t
|
||||||
|
(split-string
|
||||||
|
(string-trim-left (string-trim-right trimmed ":+") ":+")
|
||||||
|
":" t))))))))
|
||||||
|
|
||||||
|
(defun org-roam-export-blog--first-paragraph-text (buffer)
|
||||||
|
"Return the plain text of the first paragraph in BUFFER."
|
||||||
|
(with-current-buffer buffer
|
||||||
|
(let ((para (org-element-map (org-element-parse-buffer) 'paragraph
|
||||||
|
#'identity nil t)))
|
||||||
|
(when para
|
||||||
|
(replace-regexp-in-string
|
||||||
|
"[ \t\n]+" " "
|
||||||
|
(string-trim
|
||||||
|
(substring-no-properties (org-roam-export-blog--plain-text para))))))))
|
||||||
|
|
||||||
|
(defun org-roam-export-blog--roam-refs (file)
|
||||||
|
"Return the first :ROAM_REFS: URL of the note in FILE, or nil."
|
||||||
|
(with-current-buffer (find-file-noselect file)
|
||||||
|
(org-with-wide-buffer
|
||||||
|
(goto-char (point-min))
|
||||||
|
(let ((value (org-entry-get (point) "ROAM_REFS")))
|
||||||
|
(when value (car (split-string value "[ \t]+")))))))
|
||||||
|
|
||||||
|
(defun org-roam-export-blog--note-title (file)
|
||||||
|
"Return the #+TITLE: of the note in FILE, or nil."
|
||||||
|
(org-roam-export-blog--title (find-file-noselect file)))
|
||||||
|
|
||||||
|
;;; Link processing
|
||||||
|
|
||||||
|
(defun org-roam-export-blog--vault-attach-dir (file)
|
||||||
|
"Return the .attach directory dominating FILE, or nil."
|
||||||
|
(when-let* ((root (locate-dominating-file file ".attach")))
|
||||||
|
(expand-file-name ".attach" root)))
|
||||||
|
|
||||||
|
(defun org-roam-export-blog--image-p (file)
|
||||||
|
"Return non-nil when FILE looks like an image attachment."
|
||||||
|
(member (downcase (file-name-extension file))
|
||||||
|
org-roam-export-blog-image-extensions))
|
||||||
|
|
||||||
|
(defun org-roam-export-blog--link-description (link)
|
||||||
|
"Return the description text of LINK, or nil."
|
||||||
|
(let ((begin (org-element-property :contents-begin link))
|
||||||
|
(end (org-element-property :contents-end link)))
|
||||||
|
(when (and begin end)
|
||||||
|
(buffer-substring-no-properties begin end))))
|
||||||
|
|
||||||
|
(defun org-roam-export-blog--desc-or (desc fallback)
|
||||||
|
"Return trimmed DESC, or FALLBACK when DESC is nil or empty.
|
||||||
|
|
||||||
|
An empty string is truthy in Elisp, so descriptions must be
|
||||||
|
treated as absent explicitly."
|
||||||
|
(let ((trimmed (when desc (string-trim desc))))
|
||||||
|
(if (and trimmed (not (string-empty-p trimmed)))
|
||||||
|
trimmed
|
||||||
|
fallback)))
|
||||||
|
|
||||||
|
(defun org-roam-export-blog--desc-verbatim-or (desc fallback)
|
||||||
|
"Return DESC unchanged, or FALLBACK when DESC is nil or blank.
|
||||||
|
|
||||||
|
Used for plain-text replacements: a description like \"Jev \"
|
||||||
|
may carry the spacing that separated it from surrounding text in
|
||||||
|
the org source."
|
||||||
|
(if (and desc (not (string-empty-p (string-trim desc))))
|
||||||
|
desc
|
||||||
|
fallback))
|
||||||
|
|
||||||
|
(defun org-roam-export-blog--attachment-path (link vault-attach-dir note-id)
|
||||||
|
"Return the absolute source path of attachment LINK, or nil.
|
||||||
|
|
||||||
|
Handles three shapes: file links already normalized by org to an
|
||||||
|
absolute path under the vault's .attach directory, plain
|
||||||
|
attachment: links and fuzzy links carrying an attachment: prefix.
|
||||||
|
Resolution follows the org-attach ID scheme:
|
||||||
|
.attach/<first two ID chars>/<rest of ID>/<path>."
|
||||||
|
(let* ((type (org-element-property :type link))
|
||||||
|
(path (org-element-property :path link))
|
||||||
|
(bare (if (and (equal type "fuzzy")
|
||||||
|
(string-prefix-p "attachment:" path))
|
||||||
|
(substring path (length "attachment:"))
|
||||||
|
path)))
|
||||||
|
(cond
|
||||||
|
((and (equal type "file") (file-name-absolute-p path)
|
||||||
|
vault-attach-dir
|
||||||
|
(string-prefix-p vault-attach-dir (expand-file-name path)))
|
||||||
|
(expand-file-name path))
|
||||||
|
((and vault-attach-dir note-id bare
|
||||||
|
(>= (length note-id) 2))
|
||||||
|
(let ((candidate (expand-file-name
|
||||||
|
(concat (substring note-id 0 2)
|
||||||
|
"/" (substring note-id 2)
|
||||||
|
"/" bare)
|
||||||
|
vault-attach-dir)))
|
||||||
|
(when (file-exists-p candidate) candidate)))
|
||||||
|
(t nil))))
|
||||||
|
|
||||||
|
(defun org-roam-export-blog--resolve-id (id)
|
||||||
|
"Return the file containing org ID, or nil."
|
||||||
|
(ignore-errors (org-id-find id)))
|
||||||
|
|
||||||
|
(defun org-roam-export-blog--link-replacement (link vault-attach-dir note-id target)
|
||||||
|
"Compute the replacement for LINK.
|
||||||
|
|
||||||
|
TARGET supplies the blog-specific image conventions. Return
|
||||||
|
(REPLACEMENT WARNINGS IMAGES), where REPLACEMENT is org syntax to
|
||||||
|
substitute for the link (nil leaves the link alone), WARNINGS is
|
||||||
|
a list of warning strings and IMAGES is a list of
|
||||||
|
(SOURCE DEST WEB-PATH) file copies to perform."
|
||||||
|
(let* ((type (org-element-property :type link))
|
||||||
|
(path (org-element-property :path link))
|
||||||
|
(desc (org-roam-export-blog--link-description link))
|
||||||
|
(replacement nil)
|
||||||
|
(warnings nil)
|
||||||
|
(images nil))
|
||||||
|
(cond
|
||||||
|
;; Roam refs: [[id:uuid][text]]
|
||||||
|
((equal type "id")
|
||||||
|
(let* ((target-file (org-roam-export-blog--resolve-id path))
|
||||||
|
(refs (when target-file
|
||||||
|
(org-roam-export-blog--roam-refs (car target-file)))))
|
||||||
|
(cond
|
||||||
|
((and target-file refs)
|
||||||
|
(setq replacement (format "[[%s][%s]]"
|
||||||
|
refs (org-roam-export-blog--desc-or desc refs))))
|
||||||
|
(target-file
|
||||||
|
(setq replacement (org-roam-export-blog--desc-verbatim-or
|
||||||
|
desc (or (org-roam-export-blog--note-title (car target-file))
|
||||||
|
"")))
|
||||||
|
(push (format "dropped ref: id %s has no ROAM_REFS, kept plain text %S"
|
||||||
|
path replacement)
|
||||||
|
warnings))
|
||||||
|
(t
|
||||||
|
(setq replacement (org-roam-export-blog--desc-verbatim-or desc ""))
|
||||||
|
(push (format "dropped ref: unresolved id %s, kept plain text %S"
|
||||||
|
path replacement)
|
||||||
|
warnings)))))
|
||||||
|
;; Attachments (and file links that org normalized from attachments)
|
||||||
|
((and vault-attach-dir
|
||||||
|
(or (member type '("file" "attachment"))
|
||||||
|
(and (equal type "fuzzy")
|
||||||
|
(string-prefix-p "attachment:" path))))
|
||||||
|
(let ((source (org-roam-export-blog--attachment-path link vault-attach-dir note-id)))
|
||||||
|
(cond
|
||||||
|
((and source (file-exists-p source) (org-roam-export-blog--image-p source))
|
||||||
|
(let* ((name (file-name-nondirectory source))
|
||||||
|
(year (car (org-roam-export-blog--date-parts)))
|
||||||
|
(web-path (funcall (plist-get target :image-url) name year))
|
||||||
|
(dest (funcall (plist-get target :image-dest) name year)))
|
||||||
|
(setq images (list (list source dest web-path)))
|
||||||
|
(setq replacement
|
||||||
|
(format "[[file:%s][%s]]" web-path
|
||||||
|
(org-roam-export-blog--desc-or desc
|
||||||
|
(file-name-base name))))))
|
||||||
|
((and source (file-exists-p source))
|
||||||
|
(setq replacement (org-roam-export-blog--desc-verbatim-or desc ""))
|
||||||
|
(push (format "ignored attachment (not an image): %s"
|
||||||
|
(file-name-nondirectory source))
|
||||||
|
warnings))
|
||||||
|
(t
|
||||||
|
(setq replacement (org-roam-export-blog--desc-verbatim-or desc ""))
|
||||||
|
(push (format "unhandled link dropped: %s:%s" type path)
|
||||||
|
warnings)))))
|
||||||
|
;; Any other file: link points into the vault, not the blog.
|
||||||
|
((equal type "file")
|
||||||
|
(setq replacement (org-roam-export-blog--desc-verbatim-or desc ""))
|
||||||
|
(push (format "unhandled link dropped: file:%s" path) warnings))
|
||||||
|
;; Everything else (https, mailto, ...) passes through untouched.
|
||||||
|
(t nil))
|
||||||
|
(list replacement warnings images)))
|
||||||
|
|
||||||
|
(defun org-roam-export-blog--process-links (buffer vault-attach-dir target)
|
||||||
|
"Rewrite id/attachment/file links in BUFFER's text.
|
||||||
|
|
||||||
|
BUFFER is not modified; a processed copy of its text is returned.
|
||||||
|
TARGET supplies the blog-specific image conventions. Return
|
||||||
|
(TEXT WARNINGS IMAGES) where IMAGES is a list of
|
||||||
|
(SOURCE DEST WEB-PATH) image copies to perform."
|
||||||
|
(with-current-buffer buffer
|
||||||
|
(let ((text (buffer-string))
|
||||||
|
(note-id (org-entry-get (point-min) "ID"))
|
||||||
|
(warnings nil)
|
||||||
|
(all-images nil))
|
||||||
|
(let* ((tree (org-element-parse-buffer))
|
||||||
|
(replacements
|
||||||
|
(reverse
|
||||||
|
(org-element-map tree 'link
|
||||||
|
(lambda (link)
|
||||||
|
(let* ((result (org-roam-export-blog--link-replacement
|
||||||
|
link vault-attach-dir note-id target))
|
||||||
|
(replacement (nth 0 result))
|
||||||
|
(warns (nth 1 result))
|
||||||
|
(images (nth 2 result)))
|
||||||
|
(setq warnings (append warnings warns)
|
||||||
|
all-images (append all-images images))
|
||||||
|
(when replacement
|
||||||
|
(list (org-element-property :begin link)
|
||||||
|
;; :end includes :post-blank (trailing
|
||||||
|
;; whitespace); exclude it from the
|
||||||
|
;; replaced region.
|
||||||
|
(- (org-element-property :end link)
|
||||||
|
(or (org-element-property :post-blank link) 0))
|
||||||
|
replacement))))
|
||||||
|
nil nil nil))))
|
||||||
|
(dolist (r replacements)
|
||||||
|
(let ((begin (nth 0 r))
|
||||||
|
(end (nth 1 r))
|
||||||
|
(replacement (nth 2 r)))
|
||||||
|
(setq text (concat (substring text 0 (1- begin))
|
||||||
|
replacement
|
||||||
|
(substring text (1- end))))))
|
||||||
|
(list text warnings all-images)))))
|
||||||
|
|
||||||
|
;;; Markdown generation
|
||||||
|
|
||||||
|
(defun org-roam-export-blog--to-markdown (text)
|
||||||
|
"Export org TEXT to markdown with the org-roam-export-blog-md backend."
|
||||||
|
(with-temp-buffer
|
||||||
|
(insert text)
|
||||||
|
(org-mode)
|
||||||
|
(let ((out (org-export-to-buffer
|
||||||
|
'org-roam-export-blog-md "*org-roam-export-blog export*"
|
||||||
|
nil nil nil nil org-roam-export-blog--export-options)))
|
||||||
|
(with-current-buffer out (buffer-string)))))
|
||||||
|
|
||||||
|
(defun org-roam-export-blog--cleanup (markdown)
|
||||||
|
"Collapse runs of blank lines in MARKDOWN."
|
||||||
|
(replace-regexp-in-string "\n\\(?:[ \t]*\n\\)+\\'" "\n"
|
||||||
|
(replace-regexp-in-string "\n\\{3,\\}" "\n\n" markdown)))
|
||||||
|
|
||||||
|
;;; Frontmatter
|
||||||
|
|
||||||
|
(defun org-roam-export-blog--firehose-frontmatter (title description _tags image)
|
||||||
|
"Build the Elixir-term frontmatter for the firehose post.
|
||||||
|
|
||||||
|
TAGS are not used; firehose posts start with an empty tag list."
|
||||||
|
(concat "%{\n"
|
||||||
|
(format " title: %S,\n" title)
|
||||||
|
(format " author: %S,\n" org-roam-export-blog-author)
|
||||||
|
" tags: ~w(),\n"
|
||||||
|
(format " description: %S,\n" description)
|
||||||
|
(format " image: %S,\n" image)
|
||||||
|
" published: false\n"
|
||||||
|
"}\n---\n"))
|
||||||
|
|
||||||
|
(defun org-roam-export-blog--jekyll-frontmatter (title _description tags image)
|
||||||
|
"Build the YAML frontmatter for the jekyll draft.
|
||||||
|
|
||||||
|
DESCRIPTION is not used; jekyll posts carry no description key.
|
||||||
|
IMAGE is the site-absolute web path of the first image, or nil
|
||||||
|
for an empty image field."
|
||||||
|
(concat "---\n"
|
||||||
|
"layout: post\n"
|
||||||
|
(format "title: %s\n" (org-roam-export-blog--yaml-string title))
|
||||||
|
(org-roam-export-blog--yaml-tags tags)
|
||||||
|
(format "author: %s\n"
|
||||||
|
(org-roam-export-blog--yaml-string org-roam-export-blog-author))
|
||||||
|
(format "image: %s\n" (or image ""))
|
||||||
|
"---\n"))
|
||||||
|
|
||||||
|
;;; Targets
|
||||||
|
|
||||||
|
(defun org-roam-export-blog--require-root (root variable)
|
||||||
|
"Return ROOT expanded; error when unset or not an existing directory.
|
||||||
|
|
||||||
|
VARIABLE is the defcustom symbol the root came from, for the
|
||||||
|
error message. The existence check keeps a typo or an
|
||||||
|
uncloned checkout from silently creating a stray export tree."
|
||||||
|
(unless root
|
||||||
|
(user-error "org-roam-export-blog: set %s to your blog checkout" variable))
|
||||||
|
(setq root (expand-file-name root))
|
||||||
|
(unless (file-directory-p root)
|
||||||
|
(user-error "org-roam-export-blog: %s points at %s, which does not exist"
|
||||||
|
variable root))
|
||||||
|
root)
|
||||||
|
|
||||||
|
(defun org-roam-export-blog--firehose-target ()
|
||||||
|
"Return the firehose export target.
|
||||||
|
|
||||||
|
Errors when `org-roam-export-blog-firehose-root' is unset."
|
||||||
|
(let ((root (org-roam-export-blog--require-root
|
||||||
|
org-roam-export-blog-firehose-root
|
||||||
|
'org-roam-export-blog-firehose-root)))
|
||||||
|
(list
|
||||||
|
:name "firehose"
|
||||||
|
:post-path (lambda (slug)
|
||||||
|
(let ((date (org-roam-export-blog--date-parts)))
|
||||||
|
(expand-file-name
|
||||||
|
(format "app/priv/blog/engineering/%s/%s-%s-%s.md"
|
||||||
|
(nth 0 date) (nth 1 date) (nth 2 date) slug)
|
||||||
|
root)))
|
||||||
|
:image-dest (lambda (name year)
|
||||||
|
(expand-file-name
|
||||||
|
(format "app/priv/static/images/blog/%s/%s" year name)
|
||||||
|
root))
|
||||||
|
:image-url (lambda (name year)
|
||||||
|
(format "/images/blog/%s/%s" year name))
|
||||||
|
:frontmatter #'org-roam-export-blog--firehose-frontmatter)))
|
||||||
|
|
||||||
|
(defun org-roam-export-blog--jekyll-target ()
|
||||||
|
"Return the jekyll export target.
|
||||||
|
|
||||||
|
Errors when `org-roam-export-jekyll-root' is unset."
|
||||||
|
(let ((root (org-roam-export-blog--require-root
|
||||||
|
org-roam-export-jekyll-root
|
||||||
|
'org-roam-export-jekyll-root)))
|
||||||
|
(list
|
||||||
|
:name "jekyll"
|
||||||
|
:post-path (lambda (slug)
|
||||||
|
(expand-file-name (format "_drafts/%s.md" slug) root))
|
||||||
|
:image-dest (lambda (name year)
|
||||||
|
(expand-file-name
|
||||||
|
(format "attachments/blogposts/%s/%s" year name)
|
||||||
|
root))
|
||||||
|
:image-url (lambda (name year)
|
||||||
|
(format "/attachments/blogposts/%s/%s" year name))
|
||||||
|
:frontmatter #'org-roam-export-blog--jekyll-frontmatter)))
|
||||||
|
|
||||||
|
;;; Copying and writing
|
||||||
|
|
||||||
|
(defun org-roam-export-blog--copy-images (images)
|
||||||
|
"Copy IMAGES (list of SOURCE DEST WEB-PATH), warning on basename clashes."
|
||||||
|
(let ((copied nil)
|
||||||
|
(warnings nil))
|
||||||
|
(dolist (triple images)
|
||||||
|
(let ((source (nth 0 triple))
|
||||||
|
(dest (nth 1 triple)))
|
||||||
|
(cond
|
||||||
|
((member dest copied)
|
||||||
|
(push (format "skipped duplicate image copy: %s"
|
||||||
|
(file-name-nondirectory source))
|
||||||
|
warnings))
|
||||||
|
(t
|
||||||
|
(make-directory (file-name-directory dest) t)
|
||||||
|
(copy-file source dest t)
|
||||||
|
(push dest copied)))))
|
||||||
|
(nreverse warnings)))
|
||||||
|
|
||||||
|
;;; The command
|
||||||
|
|
||||||
|
(defun org-roam-export-blog--export-file (target &optional file)
|
||||||
|
"Export org-roam note FILE to a blog post for TARGET.
|
||||||
|
|
||||||
|
Return (OUTPUT-PATH . WARNINGS). Abort with `user-error' when the
|
||||||
|
note has no title or the target file already exists."
|
||||||
|
(setq file (or file (buffer-file-name)))
|
||||||
|
(unless file
|
||||||
|
(user-error "org-roam-export-blog: not visiting a file"))
|
||||||
|
(let* ((buffer (find-file-noselect file))
|
||||||
|
(title (org-roam-export-blog--title buffer)))
|
||||||
|
(unless title
|
||||||
|
(user-error "org-roam-export-blog: %s has no #+title: keyword, aborting" file))
|
||||||
|
(let* ((slug (org-roam-export-blog--slug title))
|
||||||
|
(post-path (funcall (plist-get target :post-path) slug)))
|
||||||
|
(when (file-exists-p post-path)
|
||||||
|
(user-error "org-roam-export-blog: %s already exists, aborting" post-path))
|
||||||
|
(let* ((processed (org-roam-export-blog--process-links
|
||||||
|
buffer (org-roam-export-blog--vault-attach-dir file)
|
||||||
|
target))
|
||||||
|
(text (nth 0 processed))
|
||||||
|
(link-warnings (nth 1 processed))
|
||||||
|
(images (nth 2 processed))
|
||||||
|
(copy-warnings (org-roam-export-blog--copy-images images))
|
||||||
|
(warnings (append (nreverse link-warnings) copy-warnings))
|
||||||
|
(image (when images (nth 2 (car images))))
|
||||||
|
(tags (org-roam-export-blog--filetags buffer))
|
||||||
|
(description (org-roam-export-blog--truncate-description
|
||||||
|
(org-roam-export-blog--first-paragraph-text buffer)))
|
||||||
|
(markdown (org-roam-export-blog--cleanup
|
||||||
|
(org-roam-export-blog--to-markdown text))))
|
||||||
|
(make-directory (file-name-directory post-path) t)
|
||||||
|
(with-temp-file post-path
|
||||||
|
(insert (funcall (plist-get target :frontmatter) title description tags image)
|
||||||
|
markdown))
|
||||||
|
(cons post-path warnings)))))
|
||||||
|
|
||||||
|
(defun org-roam-export-blog--run (target)
|
||||||
|
"Export the current note for TARGET and report the result.
|
||||||
|
|
||||||
|
Opens the generated post in another window."
|
||||||
|
(let* ((result (org-roam-export-blog--export-file target (buffer-file-name)))
|
||||||
|
(path (car result))
|
||||||
|
(warnings (cdr result)))
|
||||||
|
(message "org-roam-export-blog (%s): wrote %s%s"
|
||||||
|
(plist-get target :name) path
|
||||||
|
(if warnings
|
||||||
|
(format " (%d warning%s)" (length warnings)
|
||||||
|
(if (= 1 (length warnings)) "" "s"))
|
||||||
|
""))
|
||||||
|
(when warnings
|
||||||
|
(with-output-to-temp-buffer "*org-roam-export-blog warnings*"
|
||||||
|
(dolist (w warnings)
|
||||||
|
(princ (format "%s\n" w)))))
|
||||||
|
(find-file-other-window path)))
|
||||||
|
|
||||||
|
;;;###autoload
|
||||||
|
(defun org-roam-export-blog ()
|
||||||
|
"Export the current org-roam note as a firehose blog post."
|
||||||
|
(interactive)
|
||||||
|
(org-roam-export-blog--run (org-roam-export-blog--firehose-target)))
|
||||||
|
|
||||||
|
;;;###autoload
|
||||||
|
(defun org-roam-export-jekyll ()
|
||||||
|
"Export the current org-roam note as a jekyll draft."
|
||||||
|
(interactive)
|
||||||
|
(org-roam-export-blog--run (org-roam-export-blog--jekyll-target)))
|
||||||
|
|
||||||
|
(provide 'org-roam-export-blog)
|
||||||
|
;;; org-roam-export-blog.el ends here
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
some attached notes
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="10" height="10"><rect width="10" height="10"/></svg>
|
||||||
|
After Width: | Height: | Size: 100 B |
@@ -0,0 +1,7 @@
|
|||||||
|
:PROPERTIES:
|
||||||
|
:ID: 00000000-0000-0000-0000-000000000002
|
||||||
|
:ROAM_REFS: https://example.com/jev
|
||||||
|
:END:
|
||||||
|
#+title: Jev
|
||||||
|
|
||||||
|
Body of Jev.
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
:PROPERTIES:
|
||||||
|
:ID: 00000000-0000-0000-0000-000000000003
|
||||||
|
:END:
|
||||||
|
#+title: Laya
|
||||||
|
|
||||||
|
Body of Laya.
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
:PROPERTIES:
|
||||||
|
:ID: 00000000-0000-0000-0000-000000000001
|
||||||
|
:END:
|
||||||
|
#+title: Will It Blend
|
||||||
|
#+filetags: :writing:blender:
|
||||||
|
|
||||||
|
Will it Blend was a series of videos promoting a blender brand.
|
||||||
|
|
||||||
|
# A private comment that must not be exported.
|
||||||
|
|
||||||
|
[[attachment:will-it-blend.svg]]
|
||||||
|
|
||||||
|
For instance, a day after [[id:00000000-0000-0000-0000-000000000002][Jev]] came out, [[id:00000000-0000-0000-0000-000000000003][Laya]] popped up, and [[id:00000000-0000-0000-0000-000000009999][a missing note]] vanished. TODO source needed (LinkedIn)
|
||||||
|
|
||||||
|
[[attachment:attached-notes.txt]]
|
||||||
|
|
||||||
|
* I learnt this from Julia
|
||||||
|
|
||||||
|
Body text with *bold*.
|
||||||
|
|
||||||
|
#+begin_quote
|
||||||
|
A quoted comment.
|
||||||
|
#+end_quote
|
||||||
|
|
||||||
|
#+begin_src elixir
|
||||||
|
IO.puts("hi")
|
||||||
|
#+end_src
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
:PROPERTIES:
|
||||||
|
:ID: 00000000-0000-0000-0000-000000000004
|
||||||
|
:END:
|
||||||
|
|
||||||
|
No title here.
|
||||||
Reference in New Issue
Block a user