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

Docs generator improvements #413

Open
caspg opened this issue Jul 12, 2024 · 0 comments
Open

Docs generator improvements #413

caspg opened this issue Jul 12, 2024 · 0 comments

Comments

@caspg
Copy link
Contributor

caspg commented Jul 12, 2024

Motivation

Component docs are autogenerated with scripts/autogenerate.js.
There are two issues that we could try improve:

  1. Allow adding description with code examples to the component documentation.

I couldn't find a way to create nice description with code examples. @example tag (https://jsdoc.app/tags-example) doesn't seem to work.

CleanShot 2024-07-12 at 10 29 32@2x

  1. Better JSDoc for ref objects. This may be little bit harder to do and less important.

Components are functions which exposes methods using React.useImperativeHandle. To properly generate docs for those methods we need to add JSDocs. If we want to use it with TypeScript project, we can import MapViewRef interface but since this interface doesn't have JSDocs (only useImperativeHandle has it) we don't see documentation in the code editor.

We would have to duplicate JSDOc which doesn't sound like a good idea. Maybe our script could use doc from the ref interface somehow?

CleanShot 2024-07-12 at 10 43 21@2x

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

No branches or pull requests

1 participant