Docs: improve use of JSDoc
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 32.7k
- Forks
- 1.4k
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 5
Description
The sharp source code and therefore its API is already relatively well documented using JSDoc, but we can always improve.
Commit https://github.com/lovell/sharp/commit/ef849fd63907d937afce0d06b07ae778692ec500 switched the logic to generate markdown documentation for the API from documentationjs to the better-maintained jsdoc2md. This took a very basic approach to migration and didn't touch any source files, however there are future possible improvements we can now take advantage of.
- Generate a single abstract syntax tree (AST) from all source files, then write multiple output files by filtering this AST by source file.
- Add
@module,@class,@memberOfetc. annotions for correct inheritance and return types, to help prevent the "global" label. - Add
@chainableannotations where relevant, which is an extension of JSDoc supported by jsdoc-parse. - Caption all code examples via
@example <caption>Explain the example here</caption>.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Begin with commit ef849fd63907d937afce0d06b07ae778692ec500 and inspect the JSDoc in the sharp source files alongside the current jsdoc2md generation. Choose a specific improvement from the listed possibilities, then verify that the generated API markdown reflects it and existing documentation generation still succeeds.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, nodejs
- Domain
- documentation, tooling
- Issue type
- Documentation
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100