jsdoc / jsdoc/jsdoc

How to document object composition?

Open
#1,459 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
15.5k
Forks
1.5k
Avg merge
10d 23h
Merged PRs (30d)
1

Description

I'm trying to figure out how to pull in method documentation from an object to show inside another object.

My code used to look like:

class Main {
  doIt () {}
  doThis () {}
  doThat () {}
}

And jsdoc was great! However I've moved things around:

class Main {
  constructor () {
    this.sub = new Sub();
  }
  doIt () {}
}

class Sub {
  doThis () {}
  doThat () {}
}

I'd like to have the documentation show the Sub members under Main.sub (and pull the documentation from Sub)

  • Main#doIt()
  • Main.sub#doThis()
  • Main.sub#doIt()

I don't mind if I need to write out all the function names above this.sub as long as the documentation from under Sub is pulled in. I'm just not sure the syntax or if this is supported.

Thanks!

Your environment
Software Version
JSDoc v3.5.5
Node.js v8.6.0

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

The issue names JSDoc v3.5.5 and JavaScript class composition but no repository files or tests. Start by reviewing the JSDoc documentation and examples for documenting object properties and composed members, then determine whether the requested Main.sub presentation is supported and document the syntax or limitation.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
documentation
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.