Skip to content

Commit

Permalink
Update readmes
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Jul 31, 2021
1 parent ecba958 commit e76189a
Show file tree
Hide file tree
Showing 48 changed files with 740 additions and 141 deletions.
9 changes: 9 additions & 0 deletions packages/hast-util-from-string/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,19 @@ The given node is returned.

## Install

This package is [ESM only][esm]:
Node 12+ is needed to use it and it must be `imported`ed instead of `required`d.

[npm][]:

```sh
npm install hast-util-from-string
```

This package exports the following identifiers:
`fromString`.
There is no default export.

## Use

```js
Expand Down Expand Up @@ -90,6 +97,8 @@ abide by its terms.

[chat]: https://github.com/rehypejs/rehype/discussions

[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

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

[health]: https://github.com/rehypejs/.github
Expand Down
9 changes: 9 additions & 0 deletions packages/hast-util-is-body-ok-link/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,19 @@ Check if a `link` element is “Body OK”.

## Install

This package is [ESM only][esm]:
Node 12+ is needed to use it and it must be `imported`ed instead of `required`d.

[npm][]:

```sh
npm install hast-util-is-body-ok-link
```

This package exports the following identifiers:
`isBodyOkLink`.
There is no default export.

## Use

```js
Expand Down Expand Up @@ -79,6 +86,8 @@ abide by its terms.

[chat]: https://github.com/rehypejs/rehype/discussions

[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

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

[health]: https://github.com/rehypejs/.github
Expand Down
9 changes: 9 additions & 0 deletions packages/hast-util-is-conditional-comment/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,19 @@ Check if a node is a conditional comment.

## Install

This package is [ESM only][esm]:
Node 12+ is needed to use it and it must be `imported`ed instead of `required`d.

[npm][]:

```sh
npm install hast-util-is-conditional-comment
```

This package exports the following identifiers:
`isConditionalComment`.
There is no default export.

## Use

```js
Expand Down Expand Up @@ -78,6 +85,8 @@ abide by its terms.

[chat]: https://github.com/rehypejs/rehype/discussions

[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

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

[health]: https://github.com/rehypejs/.github
Expand Down
2 changes: 1 addition & 1 deletion packages/hast-util-is-css-link/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
* ## API
*
* ### `isCSSLink(node)`
* ### `isCssLink(node)`
*
* Return `true` if `node` is a `<link>` element with a `rel` list that
* contains `'stylesheet'` and has no `type`, an empty `type`, or `'text/css'`
Expand Down
11 changes: 10 additions & 1 deletion packages/hast-util-is-css-link/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,19 @@ Check if an element is a CSS link.

## Install

This package is [ESM only][esm]:
Node 12+ is needed to use it and it must be `imported`ed instead of `required`d.

[npm][]:

```sh
npm install hast-util-is-css-link
```

This package exports the following identifiers:
`isCssLink`.
There is no default export.

## Use

```js
Expand All @@ -33,7 +40,7 @@ isCssLink(h('link', {rel: ['stylesheet'], type: 'text/foo'})) //=> false

## API

### `isCSSLink(node)`
### `isCssLink(node)`

Return `true` if `node` is a `<link>` element with a `rel` list that
contains `'stylesheet'` and has no `type`, an empty `type`, or `'text/css'`
Expand Down Expand Up @@ -79,6 +86,8 @@ abide by its terms.

[chat]: https://github.com/rehypejs/rehype/discussions

[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

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

[health]: https://github.com/rehypejs/.github
Expand Down
9 changes: 9 additions & 0 deletions packages/hast-util-is-css-style/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,19 @@ Check if an element is a CSS `<style>` element.

## Install

This package is [ESM only][esm]:
Node 12+ is needed to use it and it must be `imported`ed instead of `required`d.

[npm][]:

```sh
npm install hast-util-is-css-style
```

This package exports the following identifiers:
`isCssStyle`.
There is no default export.

## Use

```js
Expand Down Expand Up @@ -78,6 +85,8 @@ abide by its terms.

[chat]: https://github.com/rehypejs/rehype/discussions

[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

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

[health]: https://github.com/rehypejs/.github
Expand Down
9 changes: 9 additions & 0 deletions packages/hast-util-is-event-handler/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,19 @@ Check if a property is an event handler.

## Install

This package is [ESM only][esm]:
Node 12+ is needed to use it and it must be `imported`ed instead of `required`d.

[npm][]:

```sh
npm install hast-util-is-event-handler
```

This package exports the following identifiers:
`isEventHandler`.
There is no default export.

## Use

```js
Expand Down Expand Up @@ -78,6 +85,8 @@ abide by its terms.

[chat]: https://github.com/rehypejs/rehype/discussions

[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

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

[health]: https://github.com/rehypejs/.github
Expand Down
9 changes: 9 additions & 0 deletions packages/hast-util-is-javascript/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,19 @@ Check if an element is a JavaScript script.

## Install

This package is [ESM only][esm]:
Node 12+ is needed to use it and it must be `imported`ed instead of `required`d.

[npm][]:

```sh
npm install hast-util-is-javascript
```

This package exports the following identifiers:
`isJavaScript`.
There is no default export.

## Use

```js
Expand Down Expand Up @@ -80,6 +87,8 @@ abide by its terms.

[chat]: https://github.com/rehypejs/rehype/discussions

[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

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

[health]: https://github.com/rehypejs/.github
Expand Down
9 changes: 9 additions & 0 deletions packages/hast-util-to-string/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,19 @@ Get the plain-text value of a hast node.

## Install

This package is [ESM only][esm]:
Node 12+ is needed to use it and it must be `imported`ed instead of `required`d.

[npm][]:

```sh
npm install hast-util-to-string
```

This package exports the following identifiers:
`toString`.
There is no default export.

## Use

```js
Expand Down Expand Up @@ -78,6 +85,8 @@ abide by its terms.

[chat]: https://github.com/rehypejs/rehype/discussions

[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

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

[health]: https://github.com/rehypejs/.github
Expand Down
22 changes: 22 additions & 0 deletions packages/html-url-attributes/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
/**
* @fileoverview
* Map of URL attributes in HTML
* @longdescription
* ## Use
*
* ```js
* import {urlAttributes} from 'html-url-attributes'
*
* urlAttributes.formAction
* //=> ['button', 'input']
* urlAttributes.href
* //=> ['a', 'area', 'base', 'link']
* ```
*
* ## API
*
* ### `urlAttributes`
*
* Map of URL attributes in HTML (`Record<string, string[]>`).
*/

export const urlAttributes = {
action: ['form'],
cite: ['blockquote', 'del', 'ins', 'q'],
Expand Down
26 changes: 26 additions & 0 deletions packages/html-url-attributes/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,36 @@ Map of URL attributes in HTML.

## Install

This package is [ESM only][esm]:
Node 12+ is needed to use it and it must be `imported`ed instead of `required`d.

[npm][]:

```sh
npm install html-url-attributes
```

This package exports the following identifiers:
`urlAttributes`.
There is no default export.

## Use

```js
import {urlAttributes} from 'html-url-attributes'

urlAttributes.formAction
//=> ['button', 'input']
urlAttributes.href
//=> ['a', 'area', 'base', 'link']
```

## API

### `urlAttributes`

Map of URL attributes in HTML (`Record<string, string[]>`).

## Contribute

See [`contributing.md`][contributing] in [`rehypejs/.github`][health] for ways
Expand Down Expand Up @@ -60,6 +84,8 @@ abide by its terms.

[chat]: https://github.com/rehypejs/rehype/discussions

[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

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

[health]: https://github.com/rehypejs/.github
Expand Down
20 changes: 20 additions & 0 deletions packages/html-whitespace-sensitive-tag-names/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
/**
* @fileoverview
* List of whitespace sensitive HTML tag names
* @longdescription
* ## Use
*
* ```js
* import {whitespaceSensitiveTagNames} from 'html-whitespace-sensitive-tag-names'
*
* whitespaceSensitiveTagNames
* //=> ['pre', 'script', 'style', 'textarea']
* ```
*
* ## API
*
* ### `whitespaceSensitiveTagNames`
*
* List of whitespace sensitive HTML tag names (`string[]`).
*/

export const whitespaceSensitiveTagNames = [
'pre',
'script',
Expand Down
24 changes: 24 additions & 0 deletions packages/html-whitespace-sensitive-tag-names/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,34 @@ List of whitespace sensitive HTML tag names.

## Install

This package is [ESM only][esm]:
Node 12+ is needed to use it and it must be `imported`ed instead of `required`d.

[npm][]:

```sh
npm install html-whitespace-sensitive-tag-names
```

This package exports the following identifiers:
`whitespaceSensitiveTagNames`.
There is no default export.

## Use

```js
import {whitespaceSensitiveTagNames} from 'html-whitespace-sensitive-tag-names'

whitespaceSensitiveTagNames
//=> ['pre', 'script', 'style', 'textarea']
```

## API

### `whitespaceSensitiveTagNames`

List of whitespace sensitive HTML tag names (`string[]`).

## Contribute

See [`contributing.md`][contributing] in [`rehypejs/.github`][health] for ways
Expand Down Expand Up @@ -60,6 +82,8 @@ abide by its terms.

[chat]: https://github.com/rehypejs/rehype/discussions

[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

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

[health]: https://github.com/rehypejs/.github
Expand Down

0 comments on commit e76189a

Please sign in to comment.