← Back to context

Comment by adityaathalye

7 months ago

Post author here... My dream: a grammar or specification for org text. So that someone can make a self-contained parser library (I'm not smart enough). So that others can embed it in all their tools, and so that someone can make an LSP for org text.

IMHO, the integration of org-mode into Emacs is a double-edged sword. Great for me, because I get batteries-included writing support. /However/ terrible for distribution. The source code of the canonical implementation is the specification. Unfortunately, it is hardwired to the Emacs binary. That fact alone makes org text verboten to most of the known universe. Even if that weren't true, the absence of a standard makes it incredibly difficult for outsiders to maintain feature-parity of their own implementations with the canon, and with each other.

> The source code of the canonical implementation is the specification.

https://orgmode.org/worg/org-syntax.html is the specification.

  • The problem is a lot of the semantics is dependent on one of a myriad of user's configs. As a simple example, TODO keywords, tag inheritance, etc.

    • You could specify what's vanilla default in the org packages.

      For that example, there's a file-local way to specify custom TODO keywords[^0]. Maybe that can get into the standard, but I'd be Ok with with a primitive, vanilla specification for org-mode first as striving to support everything would ensure no projects form around an emacs-free org-mode anytime soon.

      ---

      [^0]: https://orgmode.org/manual/Per_002dfile-keywords.html

Completely agree, on both counts. Users often ask me how they can edit their BrainTool.org file outside the extension. There's no way I can in good conscience point the average knowledge worker toward installing an emacs distro!

FWIW I use orgajs (https://github.com/orgapp/orgajs). Its well-supported and gives me a pretty complete AST. Highly recommend if you're working in JS.

My hacky solution for this when working with others has been using git post-receive/commit hooks to execute the org document (babel, pandoc, emacs html export, etc), so anybody with any editor can, if they understand the format, make changes without having to have emacs.

I heavily abuse commit hooks in my hacky CI/CD pipelines though, so ymmv.