File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change 2020With 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" );
2424const { 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
3334With the CLI, the Markdown and Typescript plugins are enabled by default.
You can’t perform that action at this time.
0 commit comments