This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-02-19
Channels
- # beginners (7)
- # boot (48)
- # clojure (50)
- # clojure-portugal (1)
- # clojure-russia (10)
- # clojure-spec (29)
- # clojure-uk (9)
- # clojurescript (116)
- # core-logic (1)
- # cursive (12)
- # datascript (2)
- # datomic (7)
- # defnpodcast (8)
- # dirac (80)
- # emacs (486)
- # hoplon (5)
- # instaparse (3)
- # keechma (1)
- # luminus (3)
- # lumo (35)
- # off-topic (65)
- # om (6)
- # onyx (6)
- # perun (42)
- # re-frame (5)
- # reagent (5)
- # rum (2)
- # untangled (170)
- # vim (13)
@bhagany thanks for the pointer regarding task order, that fixes it 🙂
One thing I’m about to try is rendering http://contentful.com data with Perun. @bhagany what do you regard as the best way to generate a bunch of files that don’t originate from individual other files? E.g. I’ll download a JSON blob and want to turn that into X html files.
@martinklepsch ooo! I've been waiting for a use-case like this
so, you'd like to do something like, make an API call, and render multiple pages based on the results?
yep, pretty much
the number of pages is defined by the result of the API call (and thus may change) if that’s the question
One way to do it would be to create “fake”/empty files in the fileset with the respective metadata I think
Just wondering if there might be a better way
(deftask contentful
[r renderer RENDERER sym "page renderer (fully qualified symbol which resolves to a function)"]
(render-task {:task-name "contentful"
:paths-fn contentful-paths
:renderer renderer
:tracer :your.ns/contentful}))
(I gotta move, will be back in 20min)
contentful-paths
takes the fileset as an argument (which you can ignore), then you'd do your API call, and return a map shaped like {"path/to/render" render-args}
heh, also, this is assuming you're running on Perun master. If you're on the most recent snapshot, then it's render-pre-wrap
instead of render-task
(this just changed today)
I wasn't familiar with http://contentful.com before this, but it seems like it might be a decent candidate for official support in Perun, if there's interest. I'm not sure where the line on that kind of thing should be, though.
bhagany: I think that having contentful task in either perun itself or as separate library are both good option. Maybe standalone library is better because there are a lot of services like contentful - https://headlesscms.org/. E.x. some time ago http://prismic.io was mentioned.
That looks like a nice solution!
Will try in a bit
I think something is wrong with that line. Causes the fileset to end up being a boolean: https://github.com/hashobject/perun/commit/392f4595c1efa0c13c90dcb38199cda541944032#diff-fcdbdc33f243f02eeb45eac4540c6427R291
Cool! I now have a static perun site rendered with Rum/Enlive and a Rum app that picks up on the client
of course you're right @martinklepsch. I don't know what I was thinking. Fixing shortly.
@martinklepsch @bhagany big +1 on integrating some http://contentful.com into perun. Have been thinking of this for a while - but haven’t come back around to it. Have used contentful extensively — it’s a great service.
It was pretty easy with the pointers @bhagany provided
@martinklepsch aside - are you doing any dev on http://status.im?
@donmullen no, mostly lurking and thinking about applications (occasionally)
I think I also am but also haven’t seen anything that had broader consumer adoption
re contentful, json files et al. — it’s kind of what I had in mind with the last guide here: https://perun.io/guides/
@martinklepsch I'm interested in your static Rum/Enlive site. Is it live, or is the code public?
hrm, I think something is going on with Runnable. I've been having tests time out or run out of memory (for a branch that changed very little) this morning. Now I just noticed that tests are being re-run for PR's that I haven't touched since yesterday. I haven't noticed this behavior before, is it normal, @podviaznikov?