cgrand/enlive — pull request #66 by mefesto (2013-05-26 22:11:07+00:00)
Title: Fix #6 - Auto-reloading of templates / snippets support

This adds opt-in support for auto-reloading of templates and snippets. The template and snippet nodes are cached. When the html resource has been modified the cached nodes are updated. Below is an example of how to opt-in:

```clojure
(ns myapp.views.example
(:require [net.cgrand.enlive-html :as html]))

(html/alter-ns-options! assoc :reloadable? true)

(html/deftemplate layout "templates/example.html" []
[:h1] (content "Hello world!"))
```

For my testing I used the following method:

```clojure
(html/alter-ns-options! assoc :reloadable?
(= (System/getenv "MODE") "dev"))
```

Which enables the auto-reload feature while in development mode only.