Skip to content

Commit

Permalink
update README example
Browse files Browse the repository at this point in the history
  • Loading branch information
mattjennings committed Nov 16, 2021
1 parent d16713e commit b84fa38
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Adds estimated reading time to your markdown files using [reading-time](https://
import readingTime from "remark-reading-time";

remark()
.use(readingTime())
.use(readingTime)
.process(markdown, function (err, file) {
console.log("Reading time is " + file.data.readingTime.text);
});
Expand All @@ -21,7 +21,7 @@ changed:
import readingTime from "remark-reading-time";

remark()
.use(readingTime({ attribute: "myKeyName" }))
.use(readingTime, { attribute: "myKeyName" })
.process(markdown, function (err, file) {
console.log("Reading time is " + file.data.myKeyName.text);
});
Expand All @@ -32,7 +32,7 @@ remark()
You can also export the data to MDX files:

```js
import {compile} from '@mdx-js/mdx'
import { compile } from "@mdx-js/mdx";
import readingTime from "remark-reading-time";
import readingMdxTime from "remark-reading-time/mdx";

Expand All @@ -42,6 +42,6 @@ const code = await compile(file, {
remarkReadingTime,
readingMdxTime, // register the mdx after the remarkReadingTime plugin
],
}
},
});
```

0 comments on commit b84fa38

Please sign in to comment.