dominatrix
Push brand new DOM structures into pleasant submission!
Last updated 7 years ago by killdream .
MIT · Repository · Original npm · Tarball · package.json
$ cnpm install dominatrix 
SYNC missed versions from official npm registry.

Dominatrix Build Status Dependencies Status

Push brand new DOM structures into pleasant submission!

Platform support

This library assumes an ES5 environment, but can be easily supported in ES3 platforms by the use of shims. Just include es5-shim :3

browser support

Example

var _ = require('dominatrix')

function link(a) { return _('a.link', { href: a.url }, a.text) }

var items = [
  { url: '/example/a', 'Something' }
, { url: '/example/b', 'More stuff' }
]

_('html'
 , _('head'
    , _('title', 'Mistress.')
    , _('meta', { charset: 'utf-8' }))
 , _('body'
    , _('div#content.item-list.simple-list', items.map(link))))

This generates the following HTML structure:

<html>
  <head>
    <title>Mistress.</title>
    <meta charset="utf-8">
  </head>
  <body>
    <div id="content" class="item-list simple-list">
      <a class="link" href="/example/a">Something</a>
      <a class="link" href="/example/b">More stuff</a>
    </div>
  </body>
</html>

Installing

Just grab it from NPM:

$ npm install Dominatrix

Documentation

A quick reference of the API can be built using Calliope:

$ npm install -g calliope
$ calliope build

Tests

You can run all tests using Mocha:

$ npm test

Licence

MIT/X11. ie.: do whatever you want.

Current Tags

  • 1.0.0                                ...           latest (7 years ago)

3 Versions

  • 1.0.0                                ...           7 years ago
  • 0.2.1                                ...           8 years ago
  • 0.2.0                                ...           8 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (5)

Copyright 2014 - 2017 © taobao.org |