Fork me on GitHub
#emacs
<
2021-04-21
>
West03:04:51

Anybody know a good org mode parser for Clojure? I want to make a reagent component that can display org mode documents.

solf04:04:24

@c.westrom Here’s a list of parsers: https://orgmode.org/worg/org-tools/ There’s two clojure ones in there. I haven’t tried any of these personally. Good luck though if you want to go beyond basic parsing. Only org-mode truly understands org-mode 😅

solf04:04:02

This one seems to be the your best bet: https://github.com/200ok-ch/org-parser

West11:04:03

@dromar56 Thank you. I took a look at it, and it seems like it’s not very developed. I’m thinking I’ll try using asciidoc instead.

vemv18:04:17

yeah I've repeatedly researched parseable org (for good reasons) and there's just no good solution. org-mode is a non-regular language or something like that, I forget the exact technical term. So it's not parseable and therefore you can only really work with org within org-mode (vs. clojure or any other lang)

vemv18:04:03

200ok-ch's parser is a very laudable attempt but as you sensed, it's in a POC phase. it's super slow for inputs beyond a small threshold

anonimitoraf21:04:47

In theory, one could just translate the org parser from elisp -> clojure right?

West23:04:02

@UR37CBF8D Never thought of that. Yes I suppose you could.

Rupert (All Street)08:04:57

If you only need to support a limited subset of the syntax of org mode it's reasonably straightforward to build your own parser. We have created a super quick parser for it at work for the limited subset of syntax we needed (headings, lists, code blocks and paragraphs).

West13:04:29

For some reason, when I passed my org document through it, it would not process lists and code blocks properly.