Questions tagged [jsdoc3]

JSDoc3 is an API documentation generator for JavaScript. It can be customised via a plugin mechanism and the output can be controlled via templates. It is written in Javascript and can be run with Node.js or Rhino.

JSDoc 3

JSDoc3 is an API documentation generator for JavaScript. It can be customised via a plugin mechanism and the output can be controlled via templates.

It is written in Javascript and can be run with Node.js or Rhino.

The tool can be found at https://github.com/jsdoc3/jsdoc

The documentation can be found at http://usejsdoc.org/

279 questions
177
votes
3 answers

JSDoc: Return object structure

How can I tell JSDoc about the structure of an object that is returned. I have found the @return {{field1: type, field2: type, ...}} description syntax and tried it: /** * Returns a coordinate from a given mouse or touch event * @param …
82
votes
5 answers

What's the proper way to document callbacks with jsdoc?

I've spent quite a while scouring the internet looking for the best way to properly document callbacks with jsdoc, but unfortunately, I haven't found a great one yet. Here's my question: I'm writing a Node.js library for developers. This library…
rdegges
  • 27,994
  • 16
  • 73
  • 100
44
votes
4 answers

How do I JSDoc A Nested Object's Methods?

I've been trying to use JSDoc3 to generate documentation on a file, but I'm having some difficulty. The file (which is a Require.js module) basically looks like this: define([], function() { /* * @exports mystuff/foo */ var foo =…
machineghost
  • 28,573
  • 26
  • 128
  • 197
39
votes
3 answers

Enum as @param type in JSDoc

Is it possible to use an enum for the JSDoc @param type declaration like in the following example? /** * @enum { Number } */ var TYPES = { TYPE_A: 1, TYPE_B: 2 } /** * @param { TYPES } type */ function useTypesEnum( type ) { } If I…
BuZZ-dEE
  • 3,875
  • 7
  • 48
  • 76
38
votes
3 answers

How to document a function returned by a function using JSDoc

I am using JSDoc for parameter documentation. It is clear how to document the parameter types for many_prompts, but what is the right way to document the function it returns? /** * @param {Number} - number of times to prompt * @return…
Aminadav Glickshtein
  • 17,003
  • 10
  • 63
  • 99
32
votes
2 answers

JSDoc with AngularJS

Currently within my Project we are using JSDoc, we have recently started to implement Angular and I want to continue using JSDoc to ensure that all the documentation is within the same place. I have taken a look at people mainly just saying to use…
Nick White
  • 1,562
  • 4
  • 19
  • 33
29
votes
3 answers

JSDocs: Documenting Node.js express routes

I am struggling documenting router.get calls with JSDocs. I am unable to get the documentation to display correctly on the page if I try to append it to my router call itself. /** * Health check * @memberof health */ router.get('/happy',…
Stanley Cup Phil
  • 9,502
  • 27
  • 86
  • 144
25
votes
5 answers

Default "Home" text and content for JSDoc

After running a basic JSDoc compile/render from Node.js: jsdoc file1.js file2.js I get a well-formatted document using the default template inside a directory "out". Almost all is as expected! But when opening the document, it always says "Home" on…
Greg Pettit
  • 10,305
  • 4
  • 47
  • 68
23
votes
4 answers

What is the correct JSDoc syntax for a local variable?

For a function like this... function example() { var X = 100; ... var Y = 'abc'; ... return Z; } I need to explain the purpose of some of the local variables. Adding a description like this... function example() { /** *…
Kirkland
  • 1,941
  • 4
  • 17
  • 26
20
votes
5 answers

JSDoc - how to document prototype methods

I've been trying to document the following code using JSDoc: /** * @module person */ /** * A human being. * @class * @param {string} name */ function Person(name){ this.name = name } Person.prototype = new function(){ var…
19
votes
1 answer

jsdoc proper way to document socket.on('event', function() {}) and routes handler

How to document API using jsdoc which has following form (single file) // api.js exports.addSocketEvents = function(socket) { /** * This will do that and ... * @param {Object} data Some data * @param {string} data.bla Something about…
Srle
  • 9,554
  • 7
  • 30
  • 58
19
votes
1 answer

Nested Methods in sidebar of JSDoc

Thanks to the answer found here: https://stackoverflow.com/a/19336366/592495 My JavaScript documentation is well-organized and well-formatted. Each namespace is a "parent" of methods contained within. However, navigation is not quite as granular as…
Greg Pettit
  • 10,305
  • 4
  • 47
  • 68
18
votes
2 answers

JSDoc Tag Support for React HOC (Higher-Order Component)

What is the proper way to document a React Higher-Order Component using JSDoc? There aren't, of course, any React-specific tags built-in - so what would be the proper approach?
18
votes
1 answer

How to document an array of objects in JSDOC

I have a function with an array of objects as parameter and would like to describe the parameter (including the properties of the objects in the array) using JSDOC like in this example: /** * @param {Array.} filter - array of filter…
doberkofler
  • 6,047
  • 10
  • 54
  • 91
18
votes
1 answer

How can I omit the source links in JsDoc?

What's the easiest way to cause JsDoc to leave out the source links? Do I have to define my own template?
jwl
  • 10,418
  • 13
  • 48
  • 86
1
2 3
18 19