Skip to content

Commit daa56bb

Browse files
author
Gilad Gray
committed
update readme
1 parent f5ca393 commit daa56bb

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,15 @@
2020
With the JavaScript API, nothing comes for free. All plugins must be registered with `.use()`.
2121

2222
```js
23-
const { Documentalist, MarkdownPlugin } = require("documentalist");
23+
const { Documentalist, MarkdownPlugin, TypescriptPlugin } = require("documentalist");
2424
const { writeFileSync } = require("fs");
2525

26-
const docs = new Documentalist()
26+
new Documentalist()
2727
.use(".md", new MarkdownPlugin())
28-
.documentGlobs("src/**/*");
29-
30-
writeFileSync("docs.json", JSON.stringify(docs, null, 2));
28+
.use(/\.tsx?$/, new TypescriptPlugin({ excludeNames: [/I.+State$/] }))
29+
.documentGlobs("src/**/*")
30+
.then(docs => JSON.stringify(docs, null, 2))
31+
.then(json => writeFileSync("docs.json", json))
3132
```
3233

3334
With the CLI, the Markdown and Typescript plugins are enabled by default.

0 commit comments

Comments
 (0)