-
-
Save davidsantiago/be8f54c948547455cd26 to your computer and use it in GitHub Desktop.
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
(deftemplate simple-tinsel [[:span {:class "foo"}]] [] (has-class? "foo") (set-content "bar")) | |
#'user/simple-tinsel | |
user=> (simple-tinsel) | |
"<span class=\"foo\">bar</span>" | |
user=> (deftemplate list-tinsel [[:ul]] [ceil] (tag= :ul) (set-content (for [x (range 1 ceil)] [:li x]))) | |
#'user/list-tinsel | |
user=> (list-tinsel 10) | |
"<ul><li>1</li><li>2</li><li>3</li><li>4</li><li>5</li><li>6</li><li>7</li><li>8</li><li>9</li></ul>" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment