Created
August 22, 2013 05:42
-
-
Save zhzhxtrrk/6303571 to your computer and use it in GitHub Desktop.
hiccup template/partial util
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns beta-shop.view-util | |
(:use hiccup.core)) | |
(defmacro defpartial | |
[fname doc-or-args & body] | |
(if (string? doc-or-args) | |
(let [args# (first body) | |
fbody# (rest body)] | |
`(defn ~fname ~doc-or-args ~args# ~@fbody#)) | |
`(defn ~fname ~doc-or-args | |
(html ~@body)))) | |
(defmacro defpage | |
[& args] | |
`(defpartial ~@args)) | |
(defmacro deflayout | |
[& args] | |
`(defpartial ~@args)) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment