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

Generate website API docs from code comments #1341

Open
afoxman opened this issue Mar 31, 2022 · 3 comments
Open

Generate website API docs from code comments #1341

afoxman opened this issue Mar 31, 2022 · 3 comments
Labels
documentation Improvements or additions to documentation

Comments

@afoxman
Copy link
Contributor

afoxman commented Mar 31, 2022

Use a tool to extract APIs and types from @rnx-kit packages. Embed them into the API docs on the website.

Example packages which can help with this:

@afoxman afoxman self-assigned this Mar 31, 2022
@afoxman afoxman moved this to 🌳 Backlog in rnx-kit Mar 31, 2022
@kelset
Copy link
Contributor

kelset commented Mar 31, 2022

yes pls! 👏

For context, there were some attempts also on the rn repo a long time ago: facebook/react-native@eb7dbc8 but as far as I know it's not actually used. I can reach out to a couple folks to verify the state of that script logic


UPDATE: it looks like the logic above was never used, but there was also this other attempt: https://github.com/facebook/react-native-website/tree/main/sync-api-docs but this one too has never been used

@kelset
Copy link
Contributor

kelset commented Apr 5, 2022

on the Expo side of things, they use a solution based on https://typedoc.org/ to export JSON

You can find the logic here: https://github.com/expo/expo/blob/main/docs/components/plugins/APISection.tsx + https://github.com/expo/expo/tree/main/docs/components/plugins/api

@tido64
Copy link
Member

tido64 commented Apr 5, 2022

Just an FYI, we are currently using TSDoc to generate the API tables for the tools-*'s README files:

const { DocExcerpt, TSDocParser } = require("@microsoft/tsdoc");

It has its own quirks. For instance, you have to manually concatenate the lines, parse parameters AST-style, and other things. It's doable, but not very friendly/maintainable. Would be interested to learn whether TypeDoc is better in this regard.

@tido64 tido64 added the documentation Improvements or additions to documentation label Feb 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
Status: 🌳 Backlog
Development

No branches or pull requests

3 participants