Skip to content

sarvex/Hiccup.jl

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hiccup

Pkg.clone("http://github.com/one-more-minute/Hiccup.jl")

Hiccup.jl is a super-simple library designed to make making HTML easy in Julia. It's heavily inspired by Clojure's Hiccup DSL.

julia> using Hiccup

julia> div("#foo.bar", "hi")
<div class="bar" id="foo">hi</div>

HTML nodes are stored as the Node{T} type which renders itself smartly.

julia> Node(:img, "#id.class1.class2", [:src=>"http://www.com"])
<img class="class1 class2" src="http://www.com" id="id"></img>

julia> tag(ans)
:img

A bunch of utility functions, with the names of tags, are provided which make this a bit more legible. You can import more with @tags:

julia> @tags img, svg

julia> svg("#id.class1.class2", [:src=>"http://www.com"])
<svg class="class1 class2" src="http://www.com" id="id"></svg>

And that's basically it.

About

HTML DSL AFAIK

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Julia 100.0%