Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@davidsantiago
Created January 30, 2013 08:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davidsantiago/be8f54c948547455cd26 to your computer and use it in GitHub Desktop.
Save davidsantiago/be8f54c948547455cd26 to your computer and use it in GitHub Desktop.
(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