1919- [ Install] ( #install )
2020- [ Use] ( #use )
2121- [ API] ( #api )
22+ - [ ` fromDocs(value[, options]) ` ] ( #fromdocsvalue-options )
23+ - [ ` Options ` ] ( #options )
24+ - [ ` Transform ` ] ( #transform )
2225- [ Syntax] ( #syntax )
2326 - [ Docblock] ( #docblock )
2427 - [ Markdown] ( #markdown )
@@ -306,7 +309,47 @@ root[9]
306309
307310## API
308311
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
310353
311354## Syntax
312355
@@ -333,10 +376,15 @@ This package is fully typed with [TypeScript][typescript].
333376See [ ` CONTRIBUTING.md ` ] ( CONTRIBUTING.md ) .
334377
335378[ docast-parse ] : https://github.com/flex-development/docast-parse
379+ [ docast-tree ] : https://github.com/flex-development/docast#root
336380[ docast ] : https://github.com/flex-development/docast
337381[ docblock ] : https://github.com/flex-development/docast#docblock-comment
338382[ 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
339385[ mdast-util-from-markdown ] : https://github.com/syntax-tree/mdast-util-from-markdown
386+ [ micromark-extension ] : https://github.com/micromark/micromark#extensions
340387[ micromark ] : https://github.com/micromark/micromark
341388[ typescript ] : https://www.typescriptlang.org
342389[ unified ] : https://github.com/unifiedjs/unified
390+ [ vfile ] : https://github.com/vfile/vfile#api
0 commit comments