Skip to content

Commit 988e7e0

Browse files
committed
update readme, bump beta version
1 parent 4be8ec8 commit 988e7e0

File tree

2 files changed

+19
-16
lines changed

2 files changed

+19
-16
lines changed

README.md

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# hast-util-from-dom
1+
# hast-util-from-dom [![Build Status][travis-badge]][travis]
22

33
Transform a DOM tree to [HAST][]
44

@@ -23,7 +23,7 @@ This utility is similar to [`hast-util-from-parse5`][hast-util-from-parse5], but
2323
Say we have the following file, `example.html`:
2424

2525
```html
26-
<!doctype html><title>Hello!</title><h1 id="world">World!<!--after--><script src="example.js"></script>
26+
<!doctype html><title>Hello!</title><h1 id="world">World!<!--after--><script src="example.js" charset="UTF-8"></script>
2727
```
2828

2929
Suppose `example.js` is a bundled version of something like this:
@@ -34,7 +34,7 @@ import fromDOM from 'hast-util-from-dom';
3434

3535
const hast = fromDOM(document.documentElement.parentNode);
3636

37-
console.log(inspect(hast));
37+
console.log(inspect.noColor(hast));
3838
```
3939

4040
Viewing `example.html` should yield the following in the console:
@@ -43,14 +43,14 @@ Viewing `example.html` should yield the following in the console:
4343
root[2]
4444
├─ doctype [name="html"]
4545
└─ element[2] [tagName="html"]
46-
├─ element[1] [tagName="head"]
47-
│ └─ element[1] [tagName="title"]
48-
│ └─ text: "Hello!"
49-
└─ element[1] [tagName="body"]
46+
├─ element[1] [tagName="head"]
47+
│ └─ element[1] [tagName="title"]
48+
│ └─ text: "Hello!"
49+
└─ element[1] [tagName="body"]
5050
└─ element[3] [tagName="h1"][properties={"id":"world"}]
51-
├─ text: "World!"
52-
├─ comment: "after"
53-
└─ element[0] [tagName="script"][properties={"src":"example.js"}]
51+
├─ text: "World!"
52+
├─ comment: "after"
53+
└─ element[0] [tagName="script"][properties={"src":"example.js","charSet":"UTF-8"}]
5454
```
5555

5656
## API
@@ -67,6 +67,10 @@ This works in a similar way to the `parse5` version except that it works directl
6767

6868
<!-- Definitions -->
6969

70+
[travis-badge]: https://img.shields.io/travis/kmck/hast-util-from-dom.svg
71+
72+
[travis]: https://travis-ci.org/kmck/hast-util-from-dom
73+
7074
[yarn]: https://yarnpkg.com/lang/en/docs/install
7175

7276
[npm]: https://docs.npmjs.com/cli/install

package.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
{
22
"name": "hast-util-from-dom",
3-
"version": "1.0.0-beta.0",
3+
"version": "1.0.0-beta.1",
44
"description": "Transform a DOM tree to HAST",
5-
"main": "dist/hast-util-from-dom.cjs.js",
6-
"module": "dist/hast-util-from-dom.esm.js",
5+
"main": "dist/hast-util-from-dom.js",
6+
"module": "dist/hast-util-from-dom.mjs",
77
"repository": "https://github.com/kmck/hast-util-from/dom/issues",
88
"author": "Keith McKnight <[email protected]> (https://keith.mcknig.ht)",
99
"license": "ISC",
1010
"scripts": {
1111
"build": "rollup -c",
1212
"lint": "eslint .",
13-
"jest": "jest",
14-
"jest:dev": "jest --watchAll",
15-
"test": "eslint . && jest"
13+
"test": "jest",
14+
"test:dev": "jest --watchAll"
1615
},
1716
"devDependencies": {
1817
"babel-core": "^6.26.3",

0 commit comments

Comments
 (0)