maplibre-react-native
maplibre-react-native copied to clipboard
Docs generator improvements
Motivation
Component docs are autogenerated with scripts/autogenerate.js
.
There are two issues that we could try improve:
- 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.
- 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?