toss / es-toolkit

A modern JavaScript utility library that's 2-3 times faster and up to 97% smaller—a major upgrade to lodash.
https://es-toolkit.slash.page
Other
6.25k stars 263 forks source link

Automate a english documentation #468

Closed dayongkr closed 6 days ago

dayongkr commented 2 weeks ago

I think that by using VitePress's dynamic route in combination with the fs Node.js module and the JSDoc parser library, comment-parser, we can automate the generation of English documentation.

So far, my attempts at parsing have been successful. However, there are still some adjustments to be made, especially in handling cases where there are multiple JSDoc comments within a single file or where JSDoc is used for declared types.

Once this work is completed, we should be able to automatically extract documentation by simply adding two files for dynamic routing to each folder like /reference/array.

I plan to finish this work by the end of next week!

dayongkr commented 2 weeks ago

There is a concern that the build time might increase since all files are re-generated during the build process. However, I believe this is a better alternative than having to manually update the documentation every time a function type is modified.

dayongkr commented 2 weeks ago
Screenshot 2024-09-01 at 11 40 00 PM

So far, everything appears to be working correctly for some functions, except for the signatures.