Bitbucket is a code hosting site with unlimited public and private repositories. We're also free for small teams!



Not ready yet. Do not use this.

Clojure templating that won't make you drink.

Dram is a Clojure templating library for Django/Jinja-like templates.

Not ready yet. Do not use this.


Don't yet.


Because I wasn't happy with any of the existing Clojure templating libraries.

Clostache and friends implement Mustache, which is a crippled templating library. It doesn't have template inheritance (without which I'd go crazy in the real world).

It also takes a very strict approach to having logic in templates (basically: "don't"). But sometimes you want logic in the templates, if it belongs there!

Hiccup is useless once you hire a frontend developer.

Frontend Dev: "Okay I'm ready to start, where's the HTML?"

Backend Dev: "It's produced by these files full of s-expressions, vectors, and hashes. There are even some API docs!"

Frontend Dev: "Did you just tell me to go fuck myself?"

Backend Dev: "I believe I did, Bob."

Enlive pushes logic into the Clojure layer where frontend developers can't effectively get at it. From my limited experience it also seems like you need to write a lot of custom Clojure code when you're using it, even for things as simple as for loops.

It might be great for teams where everyone knows Clojure. I dunno. It's pretty crazy. It's certainly not something your frontend developer is going to pick up in a week.

Django/Jinja-style templates are easy to learn for frontend developers and provide a good mix of power and simplicity.


Copyright 2012 Steve Losh and contributors.

Distributed under the MIT/X11 license.

Recent activity

Steve Losh

Commits by Steve Losh were pushed to sjl/dram

0d8ab5e - Add separated and separated1 and tests, and clean up with them.
Steve Losh

Commits by Steve Losh were pushed to sjl/dram

1bf8949 - Actually no you can't have whitespace around the pipe sorry.
Steve Losh

Commits by Steve Losh were pushed to sjl/dram

2a86296 - Add paths, and clean up the tests with a nice macro or two.
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.