Sculpt

An HTML generator in Ruby.

rb => html
Sculpt.render_doc do
    head do
        title "Sculpt"
        js "js/jquery.js", "js/sculpt.js"
        css "css/main.css", "css/sculpt.css"
    end
    body do
        h1 "Sculpt is an HTML generation tool in Ruby."
        p "Thanks to Ruby, look how neat the syntax is!"

        a "Link", "http://www.google.co.uk"

        ul ["Apple","Orange","Banana"]
        ol ["One","Two","Three"]

        p "Blue paragraph", style:"color:blue"
        div id: :mydiv do
            span "This span is in a div."
        end            
    end
end
		
<!DOCTYPE html>
<html>
<head>
<title>Sculpt</title>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/sculpt.js"></script>
<link type="text/css" rel="stylesheet" href="css/main.css">
<link type="text/css" rel="stylesheet" href="css/sculpt.css">
</head>
<body>
<h1>Sculpt is an HTML generation tool in Ruby.</h1>
<p>Thanks to Ruby, look how neat the syntax is!</p>
<a href="http://www.google.co.uk">Link</a>
<ul>
<li>Apple</li>
<li>Orange</li>
<li>Banana</li>
</ul>
<ol>
<li>One</li>
<li>Two</li>
<li>Three</li>
</ol>
<p style="color:blue">Blue paragraph</p>
<div id="mydiv">
<span>This span is in a div.</span>
</div>
</body>
</html>
install =>
gem install sculpt
readme => over here
contribute =>
# get the code (or fork it)
git clone git://github.com/alexcoplan/sculpt.git
cd sculpt

# run the tests 
gem install rspec # if you don't have rspec
rspec

# write a script
echo "require 'sculpt'; Sculpt.render { p 'hi' }" > testing.rb
ruby -Ilib testing.rb # and run it against the source

# or with IRB
irb -Ilib
> require 'sculpt'

# see the readme for info on contributing