2.2.2 Can Org Mode Documents Exist Outside of Emacs?

It has been suggested to the author that he has built far too much functionality in Emacs Lisp, and that if one is interested in putting a staticly generated site on the Indieweb, it is better implemented as a purpose-built program written in a general-purpose programming language.

Perhaps. However, if one is committed to writing in Org Mode, that avenue of attack on the problem leads us to an interesting question: how can we parse Org Mode files outside of Emacs?

Today, the reference implementation of an Org Mode parser is... Emacs Org Mode. The syntax is documented here and the implementation, in org-element.el is unusually readable, but it all exists within Emacs.

There are (numerous) parsers available, in a wide variety of languages, with various levels of fidelity to Org Mode claimed. There is an effort ongoing at the time of this writing on the emacs-orgmode list to standardize a set of test cases to make compliance more rigorous. Karl Voit independently gave a talk at EmacsConf 2021 proposing a specification which he called “Orgdown”.

So it may be that in the not too distant future, we will have Org Mode parsers in general-purpose languages which can be validated against some sort of specification, or at least a well-known test suite. However, and this has been discussed at length on the emacs-orgmode list, such a parser will either need to re-implement much of Emacs or be incomplete: how should such a parser handle Babel, for instance? Table formulas that invoke arbitrary Emacs Lisp functions? The author uses a custom Org Mode property, #+AUTODATE in his documents; if set to t, the #+DATE property will be updated every time the buffer is saved– how should that be handled?

Some argue that such a specification could only cover the “static” portions of an Org Mode document, but it’s not clear to the author exactly how that would work in the case of the “dynamic” portions generating document content.

The answer is not clear to me at this time. However, having implemented the functionaly to support putting my own sites on the Indieweb, it seemed reasonable to make that functionality available to others.