Skip to content

prertik/singultus

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

singultus

Singultus is a fork of crate which is ClojureScript implementation of the awesome Hiccup html templating library.

Usage

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

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

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

(header)
=> <header><h1>My app!</h1></header>

Differences from Hiccup

  • The singultus.core/html returns dom nodes instead of strings of html
  • You can use dom nodes in element bodies like this:
(singultus/html [:div (crate/raw "<span>foo</span><strong>bar</strong>")])
=> <div><span>foo</span><strong>bar</strong></div>

License

Copyright (C) 2011 Chris Granger

Copyright (C) 2020 Pratik Karki

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

About

A fork of the crate package (with modern changes) which provides the ClojureScript implementation of Hiccup ⛺

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Clojure 100.0%