lovell / lovell/sharp

Docs: improve use of JSDoc

Open
#3,519 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
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, @memberOf etc. annotions for correct inheritance and return types, to help prevent the "global" label.
  • Add @chainable annotations 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.