Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to reload the template when working with enlive without restar

I am using enlive for my web development. I start my ring server in repl using (serve my-app/handler)

However when I make changes to any of my html templates I have to restart my repl for the changes to show up. How do I reload my markup without restarting the repl ?

Thanks, Murtaza

like image 396
murtaza52 Avatar asked Dec 22 '25 00:12

murtaza52


1 Answers

You need to reevaluate lines that read the template. For example in my project I would have to reevaluate ("C-x C-e" in Emacs) the following line:

(def table-template (h/html-resource "META-INF/web/table.html"))

If you don't use Emacs you could try require namespace that contains templates with :reload, please see this: force clojure :reload

like image 155
Ivan Koblik Avatar answered Dec 24 '25 10:12

Ivan Koblik



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!