Skip to content

Commit

Permalink
Refactor example
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Jul 8, 2023
1 parent ca99c66 commit 801ecd3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 54 deletions.
26 changes: 0 additions & 26 deletions example.js

This file was deleted.

17 changes: 1 addition & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,8 @@
"prettier": "^2.0.0",
"remark-cli": "^11.0.0",
"remark-preset-wooorm": "^9.0.0",
"remark-usage": "^10.0.0",
"type-coverage": "^2.0.0",
"typescript": "^5.0.0",
"unified": "^10.0.0",
"xo": "^0.54.0"
},
"scripts": {
Expand All @@ -76,13 +74,7 @@
},
"remarkConfig": {
"plugins": [
"remark-preset-wooorm",
[
"remark-usage",
{
"heading": "use"
}
]
"remark-preset-wooorm"
]
},
"typeCoverage": {
Expand All @@ -98,13 +90,6 @@
"rules": {
"no-await-in-loop": "off"
}
},
{
"files": "example.js",
"rules": {
"capitalized-comments": "off",
"import/order": "off"
}
}
],
"prettier": true
Expand Down
16 changes: 4 additions & 12 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,20 +64,10 @@ In browsers with [`esm.sh`][esmsh]:

## Use

Dependencies:

```javascript
/**
* @typedef {import('mdast').Root} Root
*/

```js
import {toc} from 'mdast-util-toc'
```

Now running:

```javascript
/** @type {Root} */
/** @type {import('mdast').Root} */
const tree = {
type: 'root',
children: [
Expand All @@ -89,6 +79,8 @@ const tree = {
}

const table = toc(tree)

console.dir(table, {depth: 3})
```

Yields:
Expand Down

0 comments on commit 801ecd3

Please sign in to comment.