Added Enlive.

This commit is contained in:
Anthony Grimes 2013-01-30 05:03:09 -06:00
parent 3ef72c09c3
commit f22d7e0f43
3 changed files with 20 additions and 7 deletions

View file

@ -11,4 +11,5 @@
[hiccup "1.0.2"]
[stencil "0.3.0"]
[tinsel "0.4.0" :exclusions [hickory]]
[me.raynes/laser "0.1.21"]])
[me.raynes/laser "0.1.21"]
[enlive "1.0.1"]])

View file

@ -4,7 +4,8 @@
(:require [clabango.parser :refer [render render-file]]
[stencil.core :as stencil]
[hiccup.core :as hiccup]
[me.raynes.laser :as laser :refer [defdocument]]))
[me.raynes.laser :as laser :refer [defdocument]]
[net.cgrand.enlive-html :as enlive]))
(def bar (str "bar"))
@ -67,11 +68,14 @@
(for [x (range 1 ceil)]
(laser/node :li :content (str x)))))
(defn simple-enlive []
(str ""))
(enlive/deftemplate simple-enlive-core "clojure_template_benchmarks/templates/simple.enlive" []
[:span.foo] (enlive/content bar))
(enlive/deftemplate list-enlive-core "clojure_template_benchmarks/templates/list.enlive" [ceil]
[:ul] (enlive/clone-for [x (range 1 ceil)]
(enlive/content (str x))))
(defn list-enlive [ceil]
(str ""))
(defn simple-enlive [] (apply str (simple-enlive-core)))
(defn list-enlive [ceil] (apply str (list-enlive-core ceil)))
(defn -main [& args]
;; (println (simple-hiccup))
@ -142,4 +146,12 @@
(println "\n --- \n")
(with-progress-reporting (quick-bench (list-laser 1000)))
(println "\n --- \n")
(println "\n\n ***** enlive ***** \n\n")
(with-progress-reporting (quick-bench (simple-enlive)))
(println "\n --- \n")
(with-progress-reporting (quick-bench (list-enlive 50)))
(println "\n --- \n")
(with-progress-reporting (quick-bench (list-enlive 1000)))
(println "\n --- \n")
)

View file

@ -1 +1 @@
<ul></ul>
<ul><li></li></ul>