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

Fix and extend the auto doc-gen script #2129

Merged
merged 6 commits into from
Aug 14, 2020

Conversation

ani4aniket
Copy link
Contributor

Summary

The PR is part of an effort to extend the prior-art by @motiz88 for generating docs from comments. The project is a part of MLH Fellowship program and involves the automatic generation of the website docs from code comments and flow types as the end result.

To learn more about the project you can visit the project wiki:

Changes

  • Parse description of components from comments.
  • Generate prop info table that includes:
    • Type of prop: Parse FlowType of the prop or directly from the comments with @type annotation.
    • Platform supported: Parse using @platform annotation from the comments.
    • Default value: Parse defaultProps or @default annotation from the comments.
  • Show required label for the props parsed from the FlowType(following the latest docs convention).
  • Show platform labels such as android or ios parsed from @platform annotation (following the latest docs convention).
  • Sort props on two levels, first based on required and then lexicographically.

Preview (generated with scripts):

Changelog

[Internal]

ayushjainrksh and others added 2 commits August 6, 2020 00:44
* Add experimental script to sync API docs from code

* sync-api-docs: Support methods

* [remove before merging] Sync some API docs

* [remove before merging] Netlify fix

* sync-api-docs: add docs extraction script

* sync-api-docs: Improvements to method docs

* sync-api-docs: update docgen fork to 0.0.1

* [remove before merging] write extracted.json

* sync-api-docs: pass filename into react-docgen

* sync-api-docs: don't use PropTypes composition handler

We have Flow types for this.

* sync-api-docs: remove unused comment-parser

* sync-api-docs: bump docgen fork to 0.0.2

* [remove before merging] update Markdown files

* Sync docs with upstream

Co-authored-by: Moti Zilberman <motiz88@gmail.com>
Co-authored-by: Aniket Kumar <aniketkumar049@gmail.com>
Co-authored-by: Aniket Kumar <aniketkumar049@gmail.com>
Co-authored-by: Ayush Jain <ayushjainrksh@gmail.com>
@react-native-bot
Copy link

react-native-bot commented Aug 5, 2020

Deploy preview for react-native ready!

Built with commit b25f2b1

https://deploy-preview-2129--react-native.netlify.app

Changes to docs/ are reflected in the next "master" version.

Thank you for your contributions.

How to ContributeDocumentation Sources

@Simek Simek added the MLH Major League Hacking label Aug 13, 2020
website/yarn.lock Outdated Show resolved Hide resolved
@motiz88 motiz88 merged commit d169c56 into facebook:master Aug 14, 2020
@motiz88
Copy link
Contributor

motiz88 commented Aug 14, 2020

Thanks for your help here @Simek! I realised I should have probably squashed this the second after I hit "merge", hope that's fine...

@Simek
Copy link
Collaborator

Simek commented Aug 14, 2020

@motiz88 This PR should not be merged before the docs autogen demo next week 😞

"fs-extra": "^5.0.0",
"glob": "^7.1.2",
"glob-promise": "^3.3.0",
"he": "^1.2.0",
Copy link
Contributor Author

@ani4aniket ani4aniket Aug 14, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Simek, Can you please verify why he is removed? This was being used here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed MLH Major League Hacking
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants