Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Aug 6, 2021
1 parent 8e1a19f commit 569f6e2
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ Version 10 works with old (12) and new (13+) remark!

## Install

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.

[npm][]:

```sh
Expand Down Expand Up @@ -52,17 +55,19 @@ Some links:
* Mention: <https://github.com/ben-eb>
```

And our script, `example.js`, looks as follows:
And our module, `example.js`, looks as follows:

```js
var vfile = require('to-vfile')
var remark = require('remark')
var github = require('remark-github')
import {readSync} from 'to-vfile'
import {remark} from 'remark'
import remarkGithub from 'remark-github'

const file = readSync('example.md')

remark()
.use(github)
.process(vfile.readSync('example.md'), function (err, file) {
if (err) throw err
.use(remarkGithub)
.process(file)
.then((file) => {
console.log(String(file))
})
```
Expand Down Expand Up @@ -92,7 +97,10 @@ Some links:

## API

### `remark.use(github[, options])`
This package exports no identifiers.
The default export is `remarkGithub`.

### `unified().use(remarkGithub[, options])`

Automatically link references to commits, issues, pull-requests, and users, like
in GitHub issues, PRs, and comments (see
Expand Down

0 comments on commit 569f6e2

Please sign in to comment.