Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/ibdknox/crate
- Owner: ibdknox
- Created: 2012-02-04T21:34:53.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2015-11-02T21:08:01.000Z (about 9 years ago)
- Last Synced: 2024-05-23T00:09:43.957Z (6 months ago)
- Language: Clojure
- Homepage:
- Size: 236 KB
- Stars: 219
- Watchers: 14
- Forks: 28
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-clojurescript - Crate
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.