-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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
[docs] Autogenerate the property description for the AppBar #2382
[docs] Autogenerate the property description for the AppBar #2382
Conversation
@oliviertassinari I think we should provide some meta data for our tooling to better render the final html. First we must use Markdown, second we could add some @ tags (depending on tooling) to provide automation hooks. But for now it's awesome. just consider using markdown where ever needed. |
What's the markdown feature for? |
But yes, we could convert the output to markdown with https://github.com/reactjs/react-docgen/blob/master/example/generateMarkdown.js and then to HTML with #2226 |
Good decision.
For code examples, acceptable value tables, etc... |
I don't think that code examples should be in the description.
This will be extracted from the source code |
@oliviertassinari Well you make some good points. Alright, I'm ok with this. 👍 👍 |
@subjectix @shaurya947 I think that I'm done for this first iteration. Here is the result: The doc build fails, I'm waiting benjamn/recast#238 to be released. |
@oliviertassinari Good job 👍 Is there anyway to move the example and description to the source code too? Something like, jsdoc on the class deceleration? |
I'm done. @subjectix can you review? That the new look of the documentation page https://github.com/oliviertassinari/material-ui/blob/doc-autogenerated/docs/src/app/components/pages/components/app-bar.jsx. |
😱 Give me some time 😄 |
@@ -0,0 +1,31 @@ | |||
import React from 'react'; | |||
import AppBar from 'material-ui/app-bar'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lib
is missing, I don't know how to make it work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
try running npm run build -- --watch
on the root of the project to see if it helps.
can't webpack map paths?
I can't get it to work: Webpack outputs this:
|
I need benjamn/recast#238 to be released. |
Nevermind I cloned into the |
Ok I saw how it turned out. There are 2 major issues,
and some other prettier patterns:
P.S. stop rebasing, I can't track changes >.> |
Sorry |
IMO a table can be more pleasing to the eye. like how react-bootstrap does it. I mean even reading the props from react-native hurts my eyes 😢 If you want to keep it this way at least make the names bold. use mono-space for type and defaults, and put more space between each prop. asides from these, really awesome job 👍 👍 👍 |
Let's try it. |
@oliviertassinari It's beautiful. Great job 👍 👍 👍 |
@oliviertassinari I think it's better to annotate only the required props and oit all the optional annotations. isn't that better? since only so few are required. |
@oliviertassinari You letting generate markdown within the PropTypeDescription is pretty awesome - nice work! 👍 |
Oups, thanks for finding this. |
I have taken into account your feedbacks. |
It is used for navigation, search branding, and actions. | ||
An app bar is also referred to as the primary toolbar or action bar for Android. | ||
|
||
### Examples |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be here? I mean... shouln't it be where this file is read from?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't get it. What do you mean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Examples is inside the readme file, that means every read me MUST end with ###Examples
. shouldn't it be where you make the final markdown FROM this readme file and append this there? also maybe the title should be there too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the best practice would be to add a HeaderSection
component that takes a title and a description markdown text and renders the header section. just like the PropTypeDescription
,
@oliviertassinari Also, can you please use markdown in props description too? use ` for references and codes. |
@@ -0,0 +1,7 @@ | |||
## AppBar |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This too maybe?
@subjectix Don't you think that gets too specialized? I can easily reason about the component |
@frankf-cgn you have a point, but that |
@subjectix Indeed you have a point, too. The need to have a heading of a following component in the markdown-file makes it though to understand it. So maybe the idea with injecting the |
@frankf-cgn I like you idea. have a good night 💤 |
I think that the best abstraction for the doc is the markdown format. |
Sadly, my "injecting"-idea does not work. That's because So my 2 cents: Lets go ahead with this PR. |
🎉 I want to merge this PR first, but I need benjamn/recast#238 to be release 😒. Or to find a way to fix it here.
I think that we should migrate component per component. So yes 👍. |
@oliviertassinari Did you like this styling more than the default gfm-table? |
@frankf-cgn Lovely 👍 |
@frankf-cgn Their is still room for improvement 👍. @subjectix @frankf-cgn Thanks for your help 🎉. |
[Doc] Autogenerate the property description fo the AppBar
Awesome 👍 🎉 🎉 |
👍 great initiative @oliviertassinari @subjectix |
@oliviertassinari Really nice work and awesome idea to let the props-table beeing autogenerated! |
Just noticed this, this is awesome! 👍 |
@subjectix Are you ok with this way? It's like what react-native is doing https://github.com/facebook/react-native/blob/master/Libraries/Components/SwitchIOS/SwitchIOS.ios.js#L46.