Skip to content
This repository has been archived by the owner on Jan 19, 2018. It is now read-only.

Commit

Permalink
配置文档, 临时写, 未验证
Browse files Browse the repository at this point in the history
  • Loading branch information
tiye committed Mar 15, 2012
1 parent 97a48a5 commit 1b1485c
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 28 deletions.
22 changes: 0 additions & 22 deletions README

This file was deleted.

49 changes: 45 additions & 4 deletions README.md
Expand Up @@ -79,8 +79,49 @@ Nesting tags is avalable:
</nav>
"""

Tags must contain an '$', (html) attributes shoould not:
Tags must contain an '$', (html) attributes shoold not:

input =
id$nav:
""
input =
id$nav:
attr: 'something'
class: 'else'
"""
<nav id="id" attr="something" class="else">
</nav>
"""

Write stylesheets together with HTML, numbers will become `#{}px`

input =
$style:
body:
width: 2
$nav:
style:
background: "#eef"
"""
<style>
body{
width: 2px;
}
</style>
<nav style="background: #eef;">
</nav>
"""

You may use `$pipe` to connect pieces of codes:

a = $nav:
$text: 'Tx'
input =
$header:
$pipe: a
"""
<nav>
<header>
Tx
</header>
</nav>
"""

Really a small tool. Hope you will like it.
4 changes: 2 additions & 2 deletions json2page.coffee
Expand Up @@ -27,7 +27,7 @@ json2page = (data) ->
_tag = item.tag || 'div'
match = _tag.match /^([a-z]+)\d*$/
if _tag.match /^page\d*$/ then html += item.value
else if _tag.match /^text\d*/
else if _tag.match /^text\d*$/
html += item.value.replace('<','&lt;').replace('>','&gt;').replace(' ','&nbsp;')
else
html += "<#{match[1]} "
Expand Down Expand Up @@ -102,4 +102,4 @@ out = (data) ->
(json2page data)[1..]

if window? then window.json2page = out
if exports? then exports.json2page = out
if exports? then exports.json2page = out

0 comments on commit 1b1485c

Please sign in to comment.