Skip to content

Commit 1253cb7

Browse files
authored
Update README.md
1 parent d6e3e10 commit 1253cb7

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

README.md

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,23 @@ As with the CLI, this will look for the exported component created through `Reac
7979

8080
### parse(source \[, resolver \[, handlers \[, options\]\]\])
8181

82-
| Parameter | Type | Description |
83-
| -------------- | ------ | --------------- |
84-
| source | `string \| Buffer` | The source text |
85-
| resolver | `(ast: ASTNode, parser: { parse: (string) => ASTNode }) => (NodePath\|Array<NodePath>)` | Given an AST and a reference to the parser, it returns an (array of) NodePath which represents the component definition. |
86-
| handlers | `Array<(documentation: Documentation, definition: NodePath, parser: { parse: (string) => ASTNode }) => void>` | Each function is called with a `Documentation` object, a reference to the component definition as returned by a `resolver` and a reference to the parser. Handlers extract relevant information from the definition and augment `documentation`. |
87-
| options | `object` | see below |
82+
#### source
83+
84+
Type: `string | Buffer`
85+
86+
The source text that react-docgen will try to extract the documentation from.
87+
88+
#### resolver
89+
90+
Type: `(ast: ASTNode, parser: { parse: (string) => ASTNode }) => (NodePath | Array<NodePath>)`
91+
92+
Given an AST and a reference to the parser, it returns an (array of) NodePath which represents the component definition.
93+
94+
#### handlers
95+
96+
Type: `Array<(documentation: Documentation, definition: NodePath, parser: { parse: (string) => ASTNode }) => void>`
97+
98+
Each function is called with a `Documentation` object, a reference to the component definition as returned by a `resolver` and a reference to the parser. Handlers extract relevant information from the definition and augment `documentation`.
8899

89100
#### options
90101

0 commit comments

Comments
 (0)