|
29 | 29 | list-all-documentation.ts # List all documentation tool |
30 | 30 | get-documentation.ts # Get component documentation tool |
31 | 31 | utils/ |
32 | | - format-manifest.ts # Format component manifest to XML |
| 32 | + manifest-formatter/markdown.ts # Format component/docs manifests to markdown |
33 | 33 | parse-react-docgen.ts # Parse react-docgen output |
34 | 34 | get-manifest.ts # Fetch and validate manifest |
35 | 35 | dedent.ts # Template string dedentation |
@@ -107,19 +107,8 @@ Component manifests can include a `reactDocgen` property containing prop informa |
107 | 107 | - Extracts prop names |
108 | 108 | - Serializes TypeScript types into readable strings (handles unions, intersections, functions, objects, etc.) |
109 | 109 | - Includes optional fields: `description`, `type`, `defaultValue`, `required` |
110 | | -3. **Formatting**: The `formatComponentManifest()` function in `src/utils/format-manifest.ts` generates an XML representation of the component including a `<props>` section when `reactDocgen` is present |
111 | | -4. **Output**: Each prop is formatted as: |
112 | | - ```xml |
113 | | - <prop> |
114 | | - <prop_name>propName</prop_name> |
115 | | - <prop_type>string | number</prop_type> |
116 | | - <prop_required>false</prop_required> |
117 | | - <prop_default>"default"</prop_default> |
118 | | - <prop_description> |
119 | | - Prop description text |
120 | | - </prop_description> |
121 | | - </prop> |
122 | | - ``` |
| 110 | +3. **Formatting**: The markdown formatter in `src/utils/manifest-formatter/markdown.ts` generates markdown output for components, docs, and props (including a `## Props` section when `reactDocgen` is present) |
| 111 | +4. **Output**: Props are rendered in markdown as TypeScript-like declarations inside fenced code blocks, including optional description/default metadata when available. |
123 | 112 |
|
124 | 113 | **Type serialization examples:** |
125 | 114 |
|
|
0 commit comments