statik icon indicating copy to clipboard operation
statik copied to clipboard

[WIP] feat: Support org-file parsing to hiccup content

Open the-alex opened this issue 5 years ago • 5 comments
trafficstars

Opening this PR so you can see where I'm at here. Turns out there's a library that exposes an org->hiccup function -- wondrous! Sadly, it only takes a string, so I tried slurping it and realized ~sci doesn't support~ we didn't expose slurp in the injected namespaces. Ok, understood. Looks like I'll need to do it in core.clj or something.

Basically just putting this up so I have a place to talk it.

the-alex avatar Nov 17 '20 00:11 the-alex

I haven't tried yet, but you might be able to directly add slurp to the map on core.clj#L101.

rschmukler avatar Nov 17 '20 17:11 rschmukler

Appreciate the comments! And apologies, I think if this were anyone else's project I wouldn't have opened a WIP PR like this.

the-alex avatar Nov 17 '20 22:11 the-alex

I don't mind! Reminds me of the good ol' days!

rschmukler avatar Nov 17 '20 23:11 rschmukler

Okay, I was giving this thought today:

The spirit of this project seems to be getting up to speed with a singe statik page as fast as possible. This means that anything adding complexity or extending functionality should be either dirt cheap at the top level, or explicitly supported as something nice in the DLS.

I will argue that consuming markup and generating an html asset from it is pretty inline with the project, so the question is how much explicitly to support it in the DSL. Adding a helper function to return the title and content of a given org file is alright, but I want to think about whether this makes sense as it's own asset type, or at least a better top-level function. One can imagine applying a directory of org files to a template function, generating the equivalent of an explicit def-assets for each one.

the-alex avatar Nov 24 '20 21:11 the-alex

Sorry on the delay on this. The parse-org function looks good. I would look into also adding tree-seq which would allow someone to grab all the files in a provided directory path.

rschmukler avatar Nov 27 '20 19:11 rschmukler