I want to love the Obsidian Long Form plugin, I even hoped it was a Scrivener replacement but it's failed me again and for the last time. Opening my project to write for the book club I found that it again forgot the order of all my files. I've reorganised them a number of times, but I'm not even bothering this time.
Emacs can be a full writing studio but I'm not abandoning Obsidian, I am going to take my monthly book club writing and move it into emacs.
Migrating .md to .org
First I need to migrate individual posts from Markdown to org files. Yes I know that Emacs has a markdown mode, but after a bit of research I decided to stick with org and let Emacs do it's thing. That means I need to migrate my existing writing into org using pandoc. I can do that with the script below.
pandoc -f markdown -t org input.md -o output.org
This gives me a file called output.org and converts my footnotes to an org compatible syntax. I can then copy the generated content into the new file for each book.
My plan is to keep each book in its own .org file and have each weekly post inside a subtree (heading). I can then export each subtree to markdown as needed for posting on my site.
Fixing Footnotes
My book club posts use footnotes heavily, so I needed them to survive the export back to Markdown intact. The built-in org markdown exporter (ox-md) does include footnotes, but with two problems.
First, the footnotes section gets a top-level # Footnotes heading regardless of where it sits in your document hierarchy. This means we have an h1 in the document which isn't what I want. Second, smart quotes and apostrophes get encoded as HTML entities — ’ instead of ', “ instead of ". Again, not what I want.
Both are fixable in the export function. The smart quotes issue is handled by passing :with-smart-quotes nil to the exporter. The heading level is fixed with a post-processing step that replaces # Footnotes with #### Footnotes before the output lands in the buffer.
(after! org
(defun my/org-export-subtree-to-md ()
(interactive)
(let* ((md (org-export-as 'md t nil nil '(:with-toc nil :section-numbers nil :with-smart-quotes nil)))
(md (replace-regexp-in-string "^# Footnotes$" "#### Footnotes" md)))
(with-current-buffer (get-buffer-create "*Org MD Export*")
(erase-buffer)
(insert md)
(goto-char (point-min))
(pop-to-buffer (current-buffer)))))
(map! :map org-mode-map
:localleader
"M" #'my/org-export-subtree-to-md))
The footnote links themselves render as HTML anchor tags (<sup><a href...>) rather than Markdown footnote syntax ([^1]). That's a limitation of ox-md, but it works fine in practice since most static site generators accept inline HTML.
Exporting to Markdown
Once the footnotes issues are sorted, the export workflow is straightforward. With my cursor inside the subtree I want to export, I press \ M and a *Org MD Export* buffer opens with the Markdown output ready to copy. The \ M binding assumes your Doom localleader is set to \ — if you haven't changed it, the default is , so it would be , M instead.
The t argument in org-export-as is what limits the export to the current subtree rather than the whole file. That matters because each book lives in one .org file with multiple subtrees — one per post. Without it, you'd get the entire book's worth of content every time.
I also suppress the table of contents and section numbers since those don't belong in a blog post:
'(:with-toc nil :section-numbers nil :with-smart-quotes nil)
Creating a project
Now to make it easier to access my 2026 book posts I need to create a project. First I needed to create a folder for them, I put it inside my Obsidian vault so that it syncs to all my devices.
To keep Obsidian syncing
.orgfiles you need to go to your sync settings and choose to sync "All Other Types" so that they get caught by Obsidian's sync process
While I got the project working, every time I've tried to get a new project in Emacs it takes far more tries than I expect.
First to be viewed as a project you need a .projectile file in the folder in question1. So I typed SPC f f then went to ~/Documents/main/emacs-writing/2026-book-posts/.projectile and pressed Return. This tells me the file doesn't exist and we create it.
Next press SPC p a to add a project. Go to the same folder and press Return. Now you should be able to press SPC p p when you start Emacs and you'll see a list of your projects which you can select.
Sounds easy, but I think I restarted Emacs 3 times testing this before it worked as it should. Likely a user error.
Future Stuff?
This workflow is pretty new, as in this week, so there are a few things I'd like to explore. There is an Obsidian plugin for .org files that I'd like to try out. There is also obsidian.el which brings Obsidian features into Emacs.
I realise I'm giving up on backlinks in my writing doing things the way I am currently, but Long Form isn't working and I don't want to spend time moving files around when I have time to write.
I just want to write.
Yes
.gitand other file types work as well ↩