Skip to content
This repository has been archived by the owner on Feb 16, 2021. It is now read-only.

Support for importing React component documents by react-docgen-typescript #19

Closed
cytle opened this issue Sep 4, 2020 · 1 comment
Closed

Comments

@cytle
Copy link

cytle commented Sep 4, 2020

Subject of the feature

Markdown Api documents can be generated by react-docgen-typescript. I expect to import React component documentation in markdown by react-docgen-typescript.

Expected behavior

The Component Column.tsx

import * as React from "react";
import { Component } from "react";

/**
 * Column properties.
 */
export interface IColumnProps {
  /** prop1 description */
  prop1?: string;
  /** prop2 description */
  prop2: number;
  /**
   * prop3 description
   */
  prop3: () => void;
  /** prop4 description */
  prop4: "option1" | "option2" | "option3";
}

/**
 * Form column.
 */
export class Column extends Component<IColumnProps, {}> {
  render() {
    return <div>Test</div>;
  }
}

Convert the following Markdown:

# foo-components

## Apis

<react-docgen-typescript src="./Column.tsx" />

Into

# foo-components

## Apis

### Column

Form column.

#### props

| prop | type | default | required | description |
|---- | :----: | :-------: | :--------: | -----------|
| **prop1** | `string` | `null` | :x: | prop1 description | 
| **prop2** | `number` | `null` | :x: | prop2 description | 
| **prop3** | `() => void` | `null` | :x: | prop3 description | 
| **prop4** | `"option1" | "option2" | "option3"` | `null` | :x: | prop4 description | 

Alternatives

@cytle cytle changed the title Support for importing React component documents through react-docgen Support for importing React component documents by react-docgen-typescript Sep 4, 2020
@ChristianMurphy
Copy link
Member

Thanks for starting the discussion @cytle !
We're in the process unifying ideas in with discussions unifiedjs/collective#44
If you'd like to continue this thread, or start a new one https://github.com/remarkjs/remark/discussions/categories/ideas will be the home for ideas going forward.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

2 participants