Skip to content

Feaxer/zeus-html

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Zeus Html

Simple nodejs html generator written on coffee-script

Instalation

npm install zeus-html --save

Usage

JavaScript
var html = require("zeus-html")(true)

html.div({class: "form-group"}, function(fg){
    fg.label({}, "Text field: ")
    fg.input({type: "text", class: "form-control"})
})

html.div({class: "form-group"}, function(fg){
    fg.label({}, function(label){
        label.raw("Required text field: ")
        label.span({class: "required"}, "*")
    })
    fg.input({type: "text", class: "form-control", required: true})
})

html.button({type: "submit", class: ["btn", "btn-default"]}, "Submit")

console.log(html.output)
HTML
<div class='form-group'>
        <label>Text field: </label>
        <input type='text' class='form-control'>
</div>
<div class='form-group'>
        <label>
                Required text field:
                <span class='required'>*</span>
        </label>
        <input type='text' class='form-control' required>
</div>
<button type='submit' class='btn btn-default'>Submit</button>

About

Simple nodejs html generator written on coffee-script

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published