Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Document new `selectors` option.

  • Loading branch information...
commit 39b87b95fa1d5824151e8004519ee5ac208c7447 1 parent 04188fb
@brandonbloom authored
Showing with 14 additions and 7 deletions.
  1. +2 −0  lib/cli.coffee
  2. +12 −7 readme.md
View
2  lib/cli.coffee
@@ -16,6 +16,8 @@ exports.main = ->
args.shift()
prefix = match[1]
+ #TODO: Expose --selectors and --no-selectors flags
+
if args.length != 1
console.log """
Usage:
View
19 readme.md
@@ -20,21 +20,22 @@ html ->
head ->
title 'A simple test page'
style type: 'text/css', '.foo {\n color: red\n }'
- body class: 'awesome', ->
- div id: 'root', class: 'special', ->
+ body '.awesome', ->
+ div '#root.super.special', ->
comment 'This page is rapidly becoming not-so-simple'
h1 'A simple test page'
p ->
text 'With some awesome text, and a'
a href: 'http://www.google.com', 'link'
text '.'
- p id: 'paragraph_2', ->
+ p '#paragraph_2', ->
text 'And here is an image:'
img src: 'fake/source', title: 'not really'
text 'As well as a disabled select:'
select disabled: 'disabled', ->
option 'Oh boy!'
- script type: 'text/javascript', 'console.log("Hello there");\n console.log("How\'s it going?");
+ script type: 'text/javascript', 'console.log("Hello there");\n console.log("How\'s it going?");'
+ span()
```
# Public API
@@ -47,11 +48,15 @@ html ->
`options` is an optional hash.
-> Supported options, er, option (singular):
+> Supported options:
>
-> `prefix` prepends a string to the begining of each element functional call.
+> `prefix` prepends a string to the begining of each element functional call. (default: `''`)
>
-> For example, using the prefix `@` would result in `@body ->`. The default is `''`
+> For example, using the prefix `@` would result in `@body ->`.
+>
+> `selectors` is a boolean to toggle emitting classes and ids as a first argument to element functions as a selector string (default: true).
+>
+> For example, when true you get `div '#id.cls1.cls2`. When false you get `div id: "id", class: "cls1 cls2"`
`callback` is optional and passed `(error)` if something goes wrong.
Please sign in to comment.
Something went wrong with that request. Please try again.