Skip to content

Commit

Permalink
Refactor prose
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed May 26, 2019
1 parent c52b00e commit 474d197
Showing 1 changed file with 44 additions and 15 deletions.
59 changes: 44 additions & 15 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@
# hast-util-assert [![Build][build-badge]][build] [![Coverage][coverage-badge]][coverage] [![Downloads][downloads-badge]][downloads] [![Chat][chat-badge]][chat]
# hast-util-assert

Assert [HAST][] nodes.
[![Build][build-badge]][build]
[![Coverage][coverage-badge]][coverage]
[![Downloads][downloads-badge]][downloads]
[![Size][size-badge]][size]
[![Sponsors][sponsors-badge]][collective]
[![Backers][backers-badge]][collective]
[![Chat][chat-badge]][chat]

## Installation
[**hast**][hast] utility to assert trees.

## Install

[npm][]:

```bash
```sh
npm install hast-util-assert
```

## Usage

```javascript
```js
var assert = require('hast-util-assert')

assert({type: 'root', children: []})
Expand All @@ -28,21 +36,24 @@ assert({type: 'element', properties: {}, children: []})

## API

### `assert(node)`
### `assert(tree)`

Assert that `node` is a valid [HAST][] node. If `node` has `children`,
all children will be asserted as well.
Assert that the given `tree` is a valid [**hast**][hast] [*tree*][tree].
If `tree` is a [*parent*][parent], all [*children*][child] will be asserted as
well.

The `assert.parent`, `assert.text`, `assert.void`, and `assert.wrap`
methods from [`unist-util-assert`][unist-util-assert] are also included.

## Contribute

See [`contributing.md` in `syntax-tree/hast`][contributing] for ways to get
See [`contributing.md` in `syntax-tree/.github`][contributing] for ways to get
started.
See [`support.md`][support] for ways to get help.

This organisation has a [Code of Conduct][coc]. By interacting with this
repository, organisation, or community you agree to abide by its terms.
This project has a [Code of Conduct][coc].
By interacting with this repository, organisation, or community you agree to
abide by its terms.

## License

Expand All @@ -62,20 +73,38 @@ repository, organisation, or community you agree to abide by its terms.

[downloads]: https://www.npmjs.com/package/hast-util-assert

[size-badge]: https://img.shields.io/bundlephobia/minzip/hast-util-assert.svg

[size]: https://bundlephobia.com/result?p=hast-util-assert

[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg

[backers-badge]: https://opencollective.com/unified/backers/badge.svg

[collective]: https://opencollective.com/unified

[chat-badge]: https://img.shields.io/badge/join%20the%20community-on%20spectrum-7b16ff.svg

[chat]: https://spectrum.chat/unified/rehype
[chat]: https://spectrum.chat/unified/syntax-tree

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

[license]: license

[author]: https://wooorm.com

[hast]: https://github.com/syntax-tree/hast
[contributing]: https://github.com/syntax-tree/.github/blob/master/contributing.md

[support]: https://github.com/syntax-tree/.github/blob/master/support.md

[coc]: https://github.com/syntax-tree/.github/blob/master/code-of-conduct.md

[unist-util-assert]: https://github.com/syntax-tree/unist-util-assert

[contributing]: https://github.com/syntax-tree/hast/blob/master/contributing.md
[tree]: https://github.com/syntax-tree/unist#tree

[coc]: https://github.com/syntax-tree/hast/blob/master/code-of-conduct.md
[parent]: https://github.com/syntax-tree/unist#parent-1

[child]: https://github.com/syntax-tree/unist#child

[hast]: https://github.com/syntax-tree/hast

0 comments on commit 474d197

Please sign in to comment.