-
Notifications
You must be signed in to change notification settings - Fork 944
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
Preliminary improvements to documentation, esp internal types e.g. Units #2727
Conversation
… sure about what is a function. Parser seems to infer the function name just fine. Adding a @turfcategory tag to functions so turf-www generation can use that to categorise functions in the side menu. Avoids issues with documentation.yml getting out of date.
…s. Minimal other changes to bring JSDoc types into line with code types. Added GeoJsonProperties to documentation.yml for type linking.
…JSDoc for internal types and constants e.g. Units. Also synced up some out of data JSDoc types with what is in the code.
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 like where this is going, nice work
Thanks for taking a look @twelch. Sadly doesn't look like I'll be able to do the @turfcategory thing as documentation lint checks for unrecognised tags. Will stick with documentation.yml instead though make its usage more robust. |
…cognised tags. Instead switching the structure of documentation.yml to be more traditionally nested. We'll use this new structure from the turf-www repo to generate the website documentation in a more robust manner.
…">", and the other was the linter not liking number[][] type format.
All I need to do now is figure out how I've broken the build by updating documentation 🙌 |
Got the build fixed @twelch if you're able to take another look. |
… as some incorrect / omitted param / return values.
Some preliminary work to improve documentation, particularly around internal types. Summary of changes:
Publish documentation for internal types
Internal types like Units, DbscanProps have had some JSDoc fields added. This will make them exportable as first class pages on the website (with some corresponding changes to turf-www) which we can link to from other pages that reference them.
They are also included in the README.md for the package in which they're defined. Not able to link directly between README.md files yet though.
Move away from categorising functions via documenation.yml
Suggest instead we add a custom JSDoc tag to relevant functions (@turfcategory), and use this to sort each function into its relevant category on the website e.g. along -> Measurement, hexGrid -> Grids. Category is co-located with the function. Less error prone as any function not listed in documents.yml ends up in Others, rather than being omitted entirely.
Sort categories alphabetically
This is largely to keep the web site generation code slightly simpler. With the sheer number of categories, plus better search, the order of the categories isn't that important.
Updated some mismatched parameter types
JSDoc parameter types that were out of sync with what the function actually used were updated where spotted. Particularly focusing on internal types whose documentation will be improving e.g. string -> Units.
CODE CHANGES
Only code change was to MoranIndex type, which is now being exported. To date this wasn't a named type and is an optional import so shouldn't cause any backwards compatibility issues.