Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

addon-info: option to render a custom component for the doc table #2397

Closed
terrencewwong opened this issue Nov 29, 2017 · 1 comment
Closed

Comments

@terrencewwong
Copy link
Contributor

TLDR: I'd like to add an option like this:

{
// Overrides the `PropTable` component that renders the table.
// The props passed to this component are the props generated by react-docgen
  propTableComponent: props => {}
}

This is the reason why I'd like to add this option:

Currently the two options for modifying the styles of the doc table are these:

{
  styles: {}, // Overrides styles of addon
  marksyConf: {}, // Overrides components used to display markdown. Warning! This option's name will be likely deprecated in favor to "components" with the same API in 3.3 release. Follow this PR #1501 for details
}

However, there are some things I'd like to do with my doc table that I don't think are currently possible.

I'm using Flow right now, and if I have a prop that is an enum. It will render the literal type annotation I wrote in flow (with the bars and everything) like this:

property propType required default description
fontWeight 'regular' | 'medium' | 'bold' no - The font-weight of the text.

Instead I'd like to render the values as monospace and separated by commas

property propType required default description
fontWeight 'regular', 'medium', 'bold' no - The font-weight of the text.

Also in order to give more room to the table, I'd like to remove the required column and instead render the prop name with an asterisk.

For example:

name default description
size* 'medium' The size of the button

What do you think? I'd be more than happy to open a PR with a proof of concept!

@bjankord
Copy link

bjankord commented Dec 1, 2017

I'm interested in this feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants