Skip to content

Commit

Permalink
feat(readme): add tree example
Browse files Browse the repository at this point in the history
  • Loading branch information
voischev committed Aug 26, 2015
1 parent 95e1fbc commit d17e5cb
Showing 1 changed file with 33 additions and 5 deletions.
38 changes: 33 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ posthtml([
require('posthtml-doctype')('<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">'),
require('posthtml-to-svg-tags')(),
require('posthtml-extend-attrs')({
attrsTree: {
'.wow' : {
id: 'wow_id',
fill: '#4A83B4',
'fill-rule': 'evenodd'
attrsTree: {
'.wow' : {
id: 'wow_id',
fill: '#4A83B4',
'fill-rule': 'evenodd'
'font-family': 'Verdana'
}
}
Expand All @@ -36,6 +36,34 @@ posthtml([
});
```

## PostHTML JSON tree

__input HTML__
```html
<a class="animals" href="#">
<span class="animals__cat" style="background: url(cat.png)">Cat</span>
</a>
```

__Tree in PostHTML__
```js
{
tag: 'a',
attrs: {
class: 'animals',
href: '#'
},
content: {
tag: 'span',
attrs: {
class: 'animals__cat',
style: 'background: url(cat.png)'
},
content: 'Cat'
}
}
```

## Plugins

- [posthtml-doctype](https://github.com/posthtml/posthtml-doctype) — extend html tags doctype
Expand Down

0 comments on commit d17e5cb

Please sign in to comment.