Skip to content

Commit d80591f

Browse files
committed
docs: update usage
1 parent f45d8ed commit d80591f

File tree

1 file changed

+8
-36
lines changed

1 file changed

+8
-36
lines changed

readme.md

Lines changed: 8 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -18,30 +18,28 @@
1818
npm i -D posthtml-render
1919
```
2020

21-
> ℹ️ This module is also available for [bower](http://bower.io) and as an AMD, CommonJS and IIFE (global) module, uncompressed and compressed
22-
2321
<h2 align="center">Usage</h2>
2422

2523
### `NodeJS`
2624

2725
```js
28-
const render = require('posthtml-render')
26+
import { render } from ''posthtml-render;
2927

30-
const tree = []
28+
const tree = [];
3129

32-
const node = {}
30+
const node = {};
3331

34-
node.tag = 'ul'
35-
node.attrs = { class: 'list' }
32+
node.tag = 'ul';
33+
node.attrs = { class: 'list' };
3634
node.content = [
3735
'one',
3836
'two',
3937
'three'
40-
].map((content) => ({ tag: 'li', content }))
38+
].map((content) => ({ tag: 'li', content }));
4139

42-
tree.push(node)
40+
tree.push(node);
4341

44-
const html = render(tree, options)
42+
const html = render(tree, options);
4543

4644
```
4745

@@ -53,32 +51,6 @@ const html = render(tree, options)
5351
</ul>
5452
```
5553

56-
### `🌐 Browser`
57-
58-
```html
59-
<!DOCTYPE html>
60-
<html>
61-
<head>
62-
<title>Title</title>
63-
<script src="./node_modules/posthtml-render/lib/browser.min.js"></script>
64-
<script >
65-
const tree = {
66-
tag: 'h1',
67-
attrs: {
68-
style: 'color: red;'
69-
},
70-
content: [ 'Title' ]
71-
}
72-
73-
window.onload = function () {
74-
document.body.innerHTML = render(tree)
75-
}
76-
</script>
77-
</head>
78-
<body></body>
79-
</html>
80-
```
81-
8254
<h2 align="center">Options</h2>
8355

8456
|Name|Type|Default|Description|

0 commit comments

Comments
 (0)