Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ibdknox/crate

A ClojureScript implementation of Hiccup
https://github.com/ibdknox/crate

Last synced: 3 months ago
JSON representation

A ClojureScript implementation of Hiccup

Awesome Lists containing this project

README

        

# crate

Crate is a ClojureScript implementation of the awesome [Hiccup](https://github.com/weavejester/hiccup/) html templating library.

## Usage

```clojure
(ns myapp
(:use-macros [crate.def-macros :only [defpartial]])
(:require [crate.core :as crate]))

(crate/html [:p.woot {:id "blah"} "Hey!"])
=>

Hey!

(defpartial header []
[:header
[:h1 "My app!"]])

(header)
=>

My app!

```

## Differences from Hiccup

* The crate.core/html returns dom nodes instead of strings of html
* You can use dom nodes in element bodies like this:

```clojure
(crate/html [:div (crate/raw "foobar")])
=>


foobar

```

## License

Copyright (C) 2011 Chris Granger

Distributed under the Eclipse Public License, the same as Clojure.