Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Dec 7, 2021
1 parent 5baaa0b commit b59484c
Showing 1 changed file with 87 additions and 34 deletions.
121 changes: 87 additions & 34 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,67 @@
[![Backers][backers-badge]][collective]
[![Chat][chat-badge]][chat]

**[micromark][]** extension to support GitHub flavored markdown (GFM) [task list
**[micromark][]** extension to support GitHub Flavored Markdown (GFM) [task list
items][].
This extension matches the GFM spec for the few things it defines and otherwise
matches github.com.

## Contents

* [What is this?](#what-is-this)
* [When to use this](#when-to-use-this)
* [Install](#install)
* [Use](#use)
* [API](#api)
* [`gfmTaskListItem`](#gfmtasklistitem)
* [`gfmTaskListItemHtml`](#gfmtasklistitemhtml)
* [Types](#types)
* [Compatibility](#compatibility)
* [Security](#security)
* [Related](#related)
* [Contribute](#contribute)
* [License](#license)

## What is this?

This package is a micromark extension to add support for GFM task list items.
It matches how task list items work on `github.com`.

## When to use this

You should probably use [`micromark-extension-gfm`][micromark-extension-gfm]
instead, which combines this package with other GFM features.
Alternatively, if you don’t want all of GFM, use this package.
In many cases, when working with micromark, you’d want to use
[`micromark-extension-gfm`][micromark-extension-gfm] instead, which combines
this package with other GFM features.

## Install
When working with syntax trees, you’d want to combine this package with
[`mdast-util-gfm-task-list-item`][mdast-util-gfm-task-list-item] (or
[`mdast-util-gfm`][mdast-util-gfm] when using `micromark-extension-gfm`).

These tools are all rather low-level.
In most cases, you’d instead want to use [`remark-gfm`][remark-gfm] with
[remark][].

This package is [ESM only](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c):
Node 12+ is needed to use it and it must be `import`ed instead of `require`d.
## Install

[npm][]:
This package is [ESM only][esm].
In Node.js (version 12.20+, 14.14+, or 16.0+), install with [npm][]:

```sh
npm install micromark-extension-gfm-task-list-item
```

In Deno with [Skypack][]:

```js
import {gfmTaskListItem, gfmTaskListItemHtml} from 'https://cdn.skypack.dev/micromark-extension-gfm-task-list-item@1?dts'
```

In browsers with [Skypack][]:

```html
<script type="module">
import {gfmTaskListItem, gfmTaskListItemHtml} from 'https://cdn.skypack.dev/micromark-extension-gfm-task-list-item@1?min'
</script>
```

## Use

```js
Expand Down Expand Up @@ -69,30 +108,36 @@ Without this condition, production code is loaded.

### `gfmTaskListItem`

An extension for micromark to parse GFM task list items (can be passed in
`extensions`).

### `gfmTaskListItemHtml`

Support [task list items][].
An extension for micromark to parse checks (can be passed in `extensions`) and
one to compile as `<input>` elements (can be passed in `htmlExtensions`).
An extension to compile them to HTML (can be passed in `htmlExtensions`).

## Types

This package is fully typed with [TypeScript][].
There are no additional exported types.

## Compatibility

This package is at least compatible with all maintained versions of Node.js.
As of now, that is Node.js 12.20+, 14.14+, and 16.0+.
It also works in Deno and modern browsers.

## Security

This package is safe.

## Related

* [`remarkjs/remark`][remark]
— markdown processor powered by plugins
* [`remarkjs/remark-gfm`](https://github.com/remarkjs/remark-gfm)
— remark plugin using this and other GFM features
* [`micromark/micromark`][micromark]
— the smallest commonmark-compliant markdown parser that exists
* [`micromark/micromark-extension-gfm`][micromark-extension-gfm]
— micromark extension combining this with other GFM features
* [`syntax-tree/mdast-util-gfm-task-list-item`](https://github.com/syntax-tree/mdast-util-gfm-task-list-item)
— mdast utility to support task lists
* [`syntax-tree/mdast-util-gfm`](https://github.com/syntax-tree/mdast-util-gfm)
— mdast utility to support GFM
* [`syntax-tree/mdast-util-from-markdown`][from-markdown]
— mdast parser using `micromark` to create mdast from markdown
* [`syntax-tree/mdast-util-to-markdown`][to-markdown]
— mdast serializer to create markdown from mdast
* [`syntax-tree/mdast-util-gfm-task-list-item`][mdast-util-gfm-task-list-item]
— support GFM task list items in mdast
* [`syntax-tree/mdast-util-gfm`][mdast-util-gfm]
— support GFM in mdast
* [`remarkjs/remark-gfm`][remark-gfm]
— support GFM in remark

## Contribute

Expand Down Expand Up @@ -138,6 +183,8 @@ abide by its terms.

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

[skypack]: https://www.skypack.dev

[license]: license

[author]: https://wooorm.com
Expand All @@ -148,14 +195,20 @@ abide by its terms.

[coc]: https://github.com/micromark/.github/blob/HEAD/code-of-conduct.md

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

[from-markdown]: https://github.com/syntax-tree/mdast-util-from-markdown
[typescript]: https://www.typescriptlang.org

[to-markdown]: https://github.com/syntax-tree/mdast-util-to-markdown
[micromark]: https://github.com/micromark/micromark

[remark]: https://github.com/remarkjs/remark

[task list items]: https://github.github.com/gfm/#task-list-items-extension-

[micromark-extension-gfm]: https://github.com/micromark/micromark-extension-gfm

[mdast-util-gfm-task-list-item]: https://github.com/syntax-tree/mdast-util-gfm-task-list-item

[mdast-util-gfm]: https://github.com/syntax-tree/mdast-util-gfm

[remark-gfm]: https://github.com/remarkjs/remark-gfm

[task list items]: https://github.github.com/gfm/#task-list-items-extension-

0 comments on commit b59484c

Please sign in to comment.