@bhagany relevant quote from the docs: As mentioned earlier Perun works by passing values from task to task. Most of Perun's tasks don't write files directly but instead add information to this value so that it can all be written to files at a later stage.
@edannenberg: I think I understand that... but I'm not sure how it relates to my question about using a pod in the same manner as perun's built in tasks?
the point is you don't need a pod for what you are trying to accomplish, just run your task after the markdown task and use the passed fileset
I think it would have to be before the markdown task, but okay. why do the built in tasks use pods, if they’re not necessary?
I’m not using the filesystem (as in, a target dir) at all for this, fwiw, which is why I’m still not sure why you quoted that bit from the docs.
sorry for being cryptic, somewhat late here. was really just to point out to use the passed fileset instead of trying to do all the work again
https://github.com/Deraen/deraen.github.io/blob/blog/build.boot#L26 something like this task should to the trick
no worries, and please don’t feel pressure to continue if you’d rather not due to lateness, or any other reason. My issue was that I started with the markdown
task, since it does a superset of the work I need, and I wasn’t sure if I needed the pod that’s in there. I’ll try to continue without a pod. Thank you for your help.
yw, it looks all a bit complicated in the beginning but it's really just a long task pipeline that transforms the fileset
ooooooookay, so this is… odd, but maybe it provides me with some insight into why pods are used -
Here’s the entirety of build.boot:
(set-env!
:source-paths #{"src" "content"}
:resource-paths #{"resources"}
:dependencies '[[pandeiro/boot-http "0.7.0"]
[adzerk/boot-cljs "1.7.228-2" :scope "test"]
[adzerk/boot-reload "0.4.12" :scope "test"]
[hiccup "1.0.5"]
[perun "0.3.0" :scope "test"]
#_[circleci/clj-yaml "0.5.5" :scope "test"]
[org.pegdown/pegdown "1.6.0" :scope "test"]])
(require '[adzerk.boot-cljs :refer [cljs]]
'[pandeiro.boot-http :refer [serve]]
'[adzerk.boot-reload :refer [reload]]
'[io.perun :as p])
(deftask dev
[]
(comp (serve :resource-root "public/")
(watch)
(p/markdown)
(p/render :renderer 'nicerthantriton.core/dev-page)
(reload :asset-path "/public")
(cljs)
(p/print-meta)))
like this, I get the following output:
% boot dev
Starting reload server on <ws://localhost:63902>
Writing adzerk/boot_reload/init2725.cljs to connect to <ws://localhost:63902>...
2016-11-09 21:46:48.570:INFO::clojure-agent-send-off-pool-0: Logging initialized @19512ms
2016-11-09 21:46:48.725:INFO:oejs.Server:clojure-agent-send-off-pool-0: jetty-9.2.10.v20150310
2016-11-09 21:46:48.780:INFO:oejs.ServerConnector:clojure-agent-send-off-pool-0: Started ServerConnector@70ed13f1{HTTP/1.1}{0.0.0.0:3000}
2016-11-09 21:46:48.781:INFO:oejs.Server:clojure-agent-send-off-pool-0: Started @19723ms
Started Jetty on <http://localhost:3000>
Starting file watcher (CTRL-C to quit)...
[markdown] - parsed 1 markdown files
[render] - rendered 1 pages
Adding :require adzerk.boot-reload.init2725 to main.cljs.edn...
Compiling ClojureScript...
• public/js/main.js
({:content "<p>Super insightful placeholder text fills you with wonder and stretches your imagination. You <em>never</em> <strong><em>never</em></strong> thought such bliss was possible. Synapses fire at an exponentially increasing rate. The entire <a href=\"http://google.com?q=universe\">universe</a> submits itself to your gaze as the <em>concerned looks</em> on your loved ones' <strong>faces</strong> fade to <code>black</code>.</p>\n<pre><code>Maybe this is code? eh?\n</code></pre>\n<blockquote>\n <p>howdy mr blockquote</p>\n</blockquote>\n<ul>\n <li>well,</li>\n <li>if it isn't</li>\n <li>an unordered list</li>\n</ul>",
:extension "md",
:filename "index.md",
:full-path "/Users/brent/.boot/cache/tmp/www/nicerthantriton.com/199s/-grrwi1/index.md",
:original true,
:parent-path "",
:path "index.md",
:published #inst "2016-11-08T00:00:00.000-00:00",
:short-filename "index",
:tags ("Clojure" "Analemma"),
:title "Something about Analemmas"})
Elapsed time: 17.048 sec
If I uncomment the line [circleci/clj-yaml "0.5.5" :scope “test”]
, I get the following:
% boot dev
Starting reload server on <ws://localhost:63895>
Writing adzerk/boot_reload/init2725.cljs to connect to <ws://localhost:63895>...
2016-11-09 21:45:56.769:INFO::clojure-agent-send-off-pool-0: Logging initialized @19173ms
2016-11-09 21:45:56.892:INFO:oejs.Server:clojure-agent-send-off-pool-0: jetty-9.2.10.v20150310
2016-11-09 21:45:56.945:INFO:oejs.ServerConnector:clojure-agent-send-off-pool-0: Started ServerConnector@137c9bbc{HTTP/1.1}{0.0.0.0:3000}
2016-11-09 21:45:56.954:INFO:oejs.Server:clojure-agent-send-off-pool-0: Started @19359ms
Started Jetty on <http://localhost:3000>
Starting file watcher (CTRL-C to quit)...
[markdown] - parsed 1 markdown files
[render] - rendered 0 pages
Adding :require adzerk.boot-reload.init2725 to main.cljs.edn...
Compiling ClojureScript...
• public/js/main.js
()
Elapsed time: 18.500 sec
So… it appears that simply including clj-yaml in my dependencies causes … um… something?
I would really appreciate any insight.
It occurs to me this morning that this is probably more of a boot problem. I’ll ask there.
@bhagany I think the render functions passed to render
and collection
tasks get an argument that contains the list of all entries. That would probably be enough to render the sidebar you're describing
@bhagany https://github.com/martinklepsch/martinklepsch.org/blob/master/src/org/martinklepsch/blog.clj#L129 this is passed to the render
task
https://github.com/martinklepsch/martinklepsch.org/blob/master/src/org/martinklepsch/blog.clj#L90 and I think this is used by the collection
task
so basically inspect the argument to your render functions and you may find what you're looking for
ha! thank you. maybe I was blinded by my desire to write a task that wasn’t just a composition of other tasks.
Easy enough, once I just printed out the data passed to the render fn. thanks again.
But of course I have another question. I'm looking for a way to set the content type of rendered files. Is this something that I should look for in perun, or is this more a concern of boot-http?