Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
stelcodes opened this issue May 9, 2022 · 6 comments
Open

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

stelcodes opened this issue May 9, 2022 · 6 comments

Comments

@stelcodes
Copy link

stelcodes commented May 9, 2022

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?

@stelcodes
Copy link
Author

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?

@schoettl
Copy link
Collaborator

schoettl commented May 9, 2022

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
Copy link
Contributor

munen commented May 9, 2022

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 🙏

@schoettl
Copy link
Collaborator

schoettl commented May 9, 2022

Ups!

@munen
Copy link
Contributor

munen commented May 9, 2022

@schoettl Happy Monday morning to you, my good Sir 🥳

@stelcodes
Copy link
Author

stelcodes commented May 9, 2022

@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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants