Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
A wrapper for the freemarker template engine, http://freemarker.sourceforge.net/
Clojure
Branch: master
Failed to load latest commit information.
src/freemarker_clj Remove stray render
test-templates test case for name transform and enabled lazytest for midje
test/freemarker_clj don't hardcode warn-on-reflection
.gitignore First Commit
README.md
project.clj

README.md

freemarker-clj

A wrapper for the freemarker template engine

In its early stages, will add more features as I need them, suggestions and patches welcome

Dependency

freemarker-clj is deployed on clojars

leiningen

[freemarker-clj "0.1.0"]

maven

<dependency>
  <groupId>freemarker-clj</groupId>
  <artifactId>freemarker-clj</artifactId>
  <version>0.1.0</version>
</dependency>

Usage

Create a new template config

(use 'freemarker-clj.core)
(defonce cfg (gen-config))
(render cfg "template.ftl" {:some-seq [1 2 3] :some-map {:a 4 :b 5} :some-fn inc})

render stringifies the map, replacing hyphens with underscores

You can additionally pass a shared map to the template config

(defonce cfg (gen-config :shared {:a 1 :b 2}))
(render cfg "template.ftl" {:b 3}) ; a => 1, b => 3

Contributors

License

Copyright © 2012 Sidhant Godiwala (grinnbearit)

Distributed under the Eclipse Public License, the same as Clojure.

Something went wrong with that request. Please try again.