Fork me on GitHub
#perun
<
2017-02-19
>
martinklepsch04:02:55

@bhagany thanks for the pointer regarding task order, that fixes it 🙂

martinklepsch04:02:59

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.

bhagany04:02:51

@martinklepsch ooo! I've been waiting for a use-case like this

bhagany04:02:11

so, you'd like to do something like, make an API call, and render multiple pages based on the results?

martinklepsch04:02:24

yep, pretty much

bhagany04:02:43

okay, is it a defined set of pages?

martinklepsch04:02:25

the number of pages is defined by the result of the API call (and thus may change) if that’s the question

bhagany04:02:38

yes, that's what I was trying to say

bhagany04:02:42

thinking...

martinklepsch04:02:45

One way to do it would be to create “fake”/empty files in the fileset with the respective metadata I think

martinklepsch04:02:56

Just wondering if there might be a better way

bhagany04:02:15

yes, I think there is

bhagany04:02:34

you could write a task that looks like this:

bhagany04:02:10

(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}))

martinklepsch04:02:43

(I gotta move, will be back in 20min)

bhagany04:02:56

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}

bhagany04:02:12

oh, and render-task is io.perun/render-task

bhagany04:02:20

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)

bhagany04:02:45

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.

podviaznikov00:02:52

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.

bhagany00:02:25

Okay, that makes sense to me

martinklepsch05:02:53

That looks like a nice solution!

martinklepsch05:02:59

Will try in a bit

martinklepsch09:02:47

Cool! I now have a static perun site rendered with Rum/Enlive and a Rum app that picks up on the client

bhagany14:02:55

of course you're right @martinklepsch. I don't know what I was thinking. Fixing shortly.

donmullen14:02:43

@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.

bhagany14:02:06

thanks for the feedback

martinklepsch14:02:30

It was pretty easy with the pointers @bhagany provided

donmullen14:02:48

@martinklepsch aside - are you doing any dev on http://status.im?

martinklepsch14:02:19

@donmullen no, mostly lurking and thinking about applications (occasionally)

donmullen14:02:30

yeah - me too

donmullen14:02:13

fascinated by the possibilities of dapps / ethereum / blockchain tech

martinklepsch14:02:08

I think I also am but also haven’t seen anything that had broader consumer adoption

martinklepsch15:02:24

re contentful, json files et al. — it’s kind of what I had in mind with the last guide here: https://perun.io/guides/

bhagany15:02:30

ah, yes. thanks for connecting those dots - I only had a vague idea about it

bhagany16:02:45

@martinklepsch I'm interested in your static Rum/Enlive site. Is it live, or is the code public?

bhagany16:02:09

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?

bhagany20:02:21

well, I managed to turn all the PR branches green on Runnable, though I think I broke the integration with github on #168, and I'm not sure how