200ok-ch/org-parser

Question: Has anyone written an IR -> Hiccup transformer?

stelcodes opened this issue ยท 6 comments

I'm writing a static site generator in Clojure that allows users to manipulate intermediate representations of their content markup with functions. I'm using cybermonday for markdown files and I'd like my users to be able to write prose in org-mode files too. I'm wondering if someone has already written a transformer from the intermediate representation to HTML/Hiccup? Maybe in a separate library somewhere?

Also, if one doesn't exist, would you be open to including one in this library from a PR or is that outside the scope of the project?

Hi stelcodes,

In Organice we don't have such transformers to HTML/Hiccup. I think it is better you look for a dedicated parser library that can output HTML. Maybe a Emacs package, pandoc, Org.jl etc.

org-parser (written in clojure) is a parser library which already parses most org syntax but has no stable intermediate representation yet. It has no export function to HTML/Hiccup. But maybe you want contribute there or use it as a starting point.

Personally, I'd consider a PR for HTML/Hiccup export in Organice a bit out of scope. I guess most users would use a computer for this use case, not a web app.

munen commented

Hi @stelcodes

Thank you for opening this issue and congrats on nuzzle - it looks like a very nice SSG! We have also written a SSG in Clojure (https://github.com/200ok-ch/ukko) which uses fleet instead of hiccup. In a previous iteration, we also used hiccup, but with fleet, we can render all kinds of artifacts, not just HTML. For rendering org documents, we currently use pandoc. Nuzzle looks very nice, though, and has a really sweet logo, too(;

I think @schoettl read that your issue was opened in a sister project (https://github.com/200ok-ch/organice/) not in this repo. I agree with him that it would be valid to have rendering functionality in org-parser. It would be nice if it's a strategy pattern, too. The reason is that org-parser could, at some point, also render Org files.

I'd be happy to support, review and pull in such a change! Thank you for offering to work on this ๐Ÿ™

Ups!

munen commented

@schoettl Happy Monday morning to you, my good Sir ๐Ÿฅณ

@schoettl @munen Ok awesome! I was talking to @jaju on Clojurians and they also expressed some interest in working on this. I think a good reference point would be this cybermonday namespace: https://github.com/kiranshila/cybermonday/blob/master/src/cybermonday/lowering.cljc and especially that cybermonday.lowering/lower-ir function.

And thanks for the compliments about Nuzzle! I'm really proud of what I have so far and I'm hoping to release a v1.0.0 in the next few weeks :)