Comparing version 0.1.4 to 0.1.5
{ | ||
"name": "primjs", | ||
"version": "0.1.4", | ||
"version": "0.1.5", | ||
"description": "Natural and extensible interface markup for the web.", | ||
@@ -5,0 +5,0 @@ "main": "prim.js", |
@@ -9,3 +9,3 @@ # prim | ||
It leaves out specific rules like `img tags are self closing` to achieve maximum performance and transparency. The simple, unopinionated design of Prim allows for a healthy balance between recyclability and output certainty. | ||
It leaves out specific rules like `img tags are self-closing` to achieve maximum performance and transparency. The simple, unopinionated design of Prim allows for a healthy balance between recyclability and output certainty. | ||
@@ -83,2 +83,61 @@ Prim is great for creating web applications. The parser returns a plain HTML string that can be treated as a reusable atomic DOM node. It plays well with client-side MVC frameworks such as AngularJS and Backbone, and servers like Express (Node.js). | ||
## Documentation | ||
*identifier* | ||
creates an HTML element with `identifier` as tag name | ||
```prim | ||
div | ||
``` | ||
```html | ||
<div></div> | ||
``` | ||
*identifier/* | ||
creates a self closing HTML element with `identifier` as tag name | ||
```prim | ||
img/ | ||
``` | ||
```html | ||
<img /> | ||
``` | ||
*identifier(attributes...)* | ||
creates an HTML element with `identifier` as tag name and `attributes` as attributes | ||
```prim | ||
div(ng-app='myApp') | ||
``` | ||
```html | ||
<div ng-app='myapp'></div> | ||
``` | ||
*identifier { nodes... }* | ||
creates an HTML element with `identifier` as tag name and `nodes` as child elements | ||
```prim | ||
div { | ||
span | ||
hr/ | ||
} | ||
``` | ||
```html | ||
<div><span><span><hr /></div> | ||
``` | ||
*identifier(attributes...)/* | ||
creates a self-closing HTML element with `identifier` as tag name and `attributes` as attributes | ||
```prim | ||
input(type='text' placeholder='Username')/ | ||
``` | ||
```html | ||
<input type='text' placeholder='username' /> | ||
``` | ||
*"string"* | ||
creates a virtual HTML element with `string` as contents | ||
```prim | ||
"Hello" | ||
``` | ||
```html | ||
Hello | ||
``` | ||
## Todo | ||
@@ -88,2 +147,3 @@ | ||
- Implement end-of-markup short hand | ||
- Implement entity escapes | ||
- Plan future features |
119415
147