Skip to content

Instantly share code, notes, and snippets.

@andydude
Created June 28, 2012 07:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andydude/3009680 to your computer and use it in GitHub Desktop.
Save andydude/3009680 to your computer and use it in GitHub Desktop.
test-template
;; filename: src/test_template/core.clj
(ns test-template.core
(:require [clojure.java.io :as io]
[clostache.parser :as st]
[cheshire.core :as js]))
(defn render [template-filename json-filename]
(let [temp (str (line-seq (io/reader template-filename)))
data (js/parse-stream (io/reader json-filename) true)]
(st/render temp data)))
(defn -main [& args]
(println (apply render args)))
(defproject test-template "1.0.0-SNAPSHOT"
:description "FIXME: write description"
:dependencies [[org.clojure/clojure "1.3.0"]
[de.ubercode.clostache/clostache "1.3.0"]
[cheshire "4.0.0"]]
:main test-template.core)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment