Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A wrapper for the freemarker template engine, http://freemarker.sourceforge.net/

branch: master
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.