19
19
- [ Install] ( #install )
20
20
- [ Use] ( #use )
21
21
- [ API] ( #api )
22
+ - [ ` fromDocs(value[, options]) ` ] ( #fromdocsvalue-options )
23
+ - [ ` Options ` ] ( #options )
24
+ - [ ` Transform ` ] ( #transform )
22
25
- [ Syntax] ( #syntax )
23
26
- [ Docblock] ( #docblock )
24
27
- [ Markdown] ( #markdown )
@@ -306,7 +309,47 @@ root[9]
306
309
307
310
## API
308
311
309
- ** TODO** : api
312
+ This package exports the identifier [ ` fromDocs ` ] ( #fromdocsvalue-options ) . There is no default export.
313
+
314
+ ### ` fromDocs(value[, options]) `
315
+
316
+ Turn docblocks into a syntax tree.
317
+
318
+ #### Parameters
319
+
320
+ - ` value ` ([ ` VFile ` ] [ vfile ] | ` string ` ) &mdash ; source document or file containing docblocks to parse
321
+ - ` options ` ([ ` Options ` ] ( #options ) , optional) &mdash ; configuration options
322
+
323
+ #### Returns
324
+
325
+ docast tree ([ ` Root ` ] [ docast-tree ] )
326
+
327
+ ### ` Options `
328
+
329
+ Configuration options (TypeScript type).
330
+
331
+ #### Properties
332
+
333
+ - ` codeblocks ` (` OneOrMany<RegExp | string> ` , optional) &mdash ; block tag node names and tags, or regular
334
+ expressions, matching block tags that should have their text converted to [ ` Code ` ] [ mdast-code ] when parsed as markdown
335
+ - ** default** : ` 'example' `
336
+ - ` mdastExtensions ` ([ ` MdastExtension[] ` ] [ mdast-util-extension ] , optional) &mdash ; markdown extensions to change how
337
+ micromark tokens are converted to nodes
338
+ - ` micromarkExtensions ` ([ ` MicromarkExtension[] ` ] [ micromark-extension ] , optional) &mdash ; micromark extensions to change
339
+ how markdown is parsed
340
+ - ` transforms ` ([ ` Transform[] ` ] ( #transform ) , optional) &mdash ; tree transforms
341
+
342
+ ### ` Transform `
343
+
344
+ Change the AST after parsing is complete (TypeScript type).
345
+
346
+ #### Parameters
347
+
348
+ - ` tree ` ([ ` Root ` ] [ docast-tree ] ) &mdash ; tree to transform
349
+
350
+ #### Returns
351
+
352
+ Nothing
310
353
311
354
## Syntax
312
355
@@ -333,10 +376,15 @@ This package is fully typed with [TypeScript][typescript].
333
376
See [ ` CONTRIBUTING.md ` ] ( CONTRIBUTING.md ) .
334
377
335
378
[ docast-parse ] : https://github.com/flex-development/docast-parse
379
+ [ docast-tree ] : https://github.com/flex-development/docast#root
336
380
[ docast ] : https://github.com/flex-development/docast
337
381
[ docblock ] : https://github.com/flex-development/docast#docblock-comment
338
382
[ esm ] : https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c
383
+ [ mdast-code ] : https://github.com/syntax-tree/mdast#code
384
+ [ mdast-util-extension ] : https://github.com/syntax-tree/mdast-util-from-markdown#extension
339
385
[ mdast-util-from-markdown ] : https://github.com/syntax-tree/mdast-util-from-markdown
386
+ [ micromark-extension ] : https://github.com/micromark/micromark#extensions
340
387
[ micromark ] : https://github.com/micromark/micromark
341
388
[ typescript ] : https://www.typescriptlang.org
342
389
[ unified ] : https://github.com/unifiedjs/unified
390
+ [ vfile ] : https://github.com/vfile/vfile#api
0 commit comments