Fork me on GitHub
#perun
<
2016-12-26
>
Petrus Theron10:12:11

Anyone around still using Perun? I’m struggling to get it going even though I followed the Getting Started page.

pesterhazy11:12:04

@petrus I'm using it right now

pesterhazy11:12:44

just discovered there hasn't been a release since Jan. It'd be great to get a new version out guys! (I'm interested in render's meta options)

Petrus Theron11:12:50

I’m getting this error:

❯ boot dev                                                                                                                                                                                    [13:27:49]
             clojure.lang.ExceptionInfo: java.lang.IllegalArgumentException: option :renderer must be of type sym
    data: {:file
           "/var/folders/8j/27sz_2rj0kd1b3v9y4n1_1t00000gn/T/boot.user1717875104820046032.clj",
           :line 29}
with this simple definion of renderer:
(defn renderer [{global :meta posts :entries post :entry}] (:name post))

(deftask build-dev
  "Build blog but don't push anywhere. Todo: combine this with prod."
  []
  (comp (markdown)
    (render :renderer renderer)
    (notify)))
But I can run ❯ boot serve --resource-root public markdown render -r site.core/page wait when site.core/page is a fn.

Petrus Theron11:12:11

Have tried (render :renderer ‘#renderer) but no luck

pesterhazy11:12:00

try 'site.core/page

Petrus Theron11:12:41

Is there a way I can keep boot “running” so I don’t have to wait for the JVM? I.e. run boot tasks from REPL

pesterhazy11:12:56

do boot repl

pesterhazy11:12:07

than call (boot "dev") etc

Petrus Theron11:12:49

Ok so 'render-fn almost works. I’m getting:

Starting file watcher (CTRL-C to quit)...

[markdown] - parsed 1 markdown files
java.lang.AssertionError: Assert failed: (namespace sym)
              io.perun/render-in-pod     perun.clj:  374
          io.perun/eval2147/fn/fn/fn     perun.clj:  403
          io.perun/eval1651/fn/fn/fn     perun.clj:  116
boot.task.built-in/fn/fn/fn/fn/fn/fn  built_in.clj:  264
   boot.task.built-in/fn/fn/fn/fn/fn  built_in.clj:  264
      boot.task.built-in/fn/fn/fn/fn  built_in.clj:  261
                 boot.core/run-tasks      core.clj:  794
                   boot.core/boot/fn      core.clj:  804
 clojure.core/binding-conveyor-fn/fn      core.clj: 1916
                                 ...
Elapsed time: 0.426 sec

Petrus Theron11:12:58

using (render :renderer 'page)

pesterhazy11:12:08

like I told you

pesterhazy11:12:17

'your.namsepace/page

Petrus Theron11:12:30

I have it defined in the build.boot namespace

Petrus Theron11:12:44

Is there a name for the “local” namespace?

Petrus Theron11:12:04

(defn page [data]
  (html5
    [:div {:style "max-width: 900px; margin: 40px auto;"}
     [:h2 "tstsrt"]
     (-> data :entry :content)]))

(deftask build-dev
  "Build blog but don't push anywhere. Todo: combine this with prod."
  []
  (comp (markdown)
    (render :renderer 'page)
    (notify)))

pesterhazy11:12:50

'boot.user/page

pesterhazy11:12:02

but not sure if that works, given that it's going to be run in a pod

pesterhazy11:12:11

may be better to use a separate ns for that

Petrus Theron11:12:36

voila. working! Now if only I can inject a boot-reload websocket thing to reload the page on render...

pesterhazy11:12:44

I just did that

Petrus Theron12:12:04

I’m getting the notify OSX alerts

pesterhazy12:12:53

it automatically reloads when you update an md file, or even css file

Petrus Theron12:12:27

I see you’re calling sync-bucket

pesterhazy12:12:53

it's confetti

Petrus Theron12:12:55

Is weasel for the reload websocket, or something else?

pesterhazy12:12:14

weasel is for the example projects, not needed

pesterhazy12:12:39

I also include the code examples in the blog source, in example-src

Petrus Theron12:12:02

cool. how are you using reagent in your static site?

pesterhazy12:12:27

some of the examples are based on reagent

pesterhazy12:12:49

also boot-reload was easier to than boot-livereload

pesterhazy12:12:01

well, "easy" is relative

Petrus Theron12:12:35

where are you injecting the JS to reload on the boot trigger?

pesterhazy12:12:28

look for include-js

pesterhazy12:12:35

I'm going out for a Christmas walk, but will be back later

pesterhazy12:12:14

it's weird that you can't pass any arguments to your render fn from build.boot

Petrus Theron12:12:03

Is it possible to use boot-reload without ClojureScript?

pesterhazy12:12:17

I don't think so...

pesterhazy14:12:27

@petrus, I've pushed a change to my repo to have a dev version (with reloading) and prod version (without)

martinklepsch15:12:10

@pesterhazy did you choose env vars over the .edn file intentionally

pesterhazy15:12:31

I like to have all my credentials in a .envrc

pesterhazy15:12:43

it's a very nice setup

martinklepsch15:12:10

cool, what's that?

martinklepsch15:12:24

is that read into the env upon cd

pesterhazy15:12:36

yes, it's a revelation. I use it for every project now

pesterhazy15:12:27

it's great for teams too, where everyone can use their own AWS key, customizations etc.

martinklepsch15:12:39

that's pretty cool indeed

martinklepsch15:12:07

Think I heard about it before but somehow thought it would be incompatible with fish. But seems it supports a bunch of shells

martinklepsch16:12:38

it's written in go though? A program for setting env vars? 😄

pesterhazy16:12:23

it's the future man, go with the flow

alandipert17:12:20

@pesterhazy: very elegant design