Skip to content

Commit

Permalink
Refactor prose
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed May 25, 2019
1 parent 349bb9a commit 8dd49af
Showing 1 changed file with 42 additions and 15 deletions.
57 changes: 42 additions & 15 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,27 @@
# hast-util-labelable [![Build][build-badge]][build] [![Coverage][coverage-badge]][coverage] [![Downloads][downloads-badge]][downloads] [![Chat][chat-badge]][chat]
# hast-util-labelable

Check whether a [HAST node][hast] is [labelable][spec].
[![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 check if an [*element*][element] is
[*labelable*][spec].

## Install

[npm][]:

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

## Usage

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

labelable({type: 'element', tagName: 'div'}) // => false
Expand All @@ -30,24 +39,28 @@ labelable({

### `labelable(node)`

Check if the given value is a [*labelable*][spec] [*element*][element].

###### Parameters

* `node` ([`Node`][node], optional) — Node to check.
* `node` (`*`, optional) — Value to check, probably [`Node`][node]

###### Returns

`boolean` — Whether `node` is a labelable element.
Labelable nodes have a `tagName` set to `button`, `keygen`,
`meter`, `output`, `progress`, `select`, `textarea`, and `input`
(excluding `[type=hidden]`.
(excluding `[type=hidden]`).

## 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 @@ -67,22 +80,36 @@ repository, organisation, or community you agree to abide by its terms.

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

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

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

[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

[spec]: https://html.spec.whatwg.org/#category-label

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

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

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

0 comments on commit 8dd49af

Please sign in to comment.