Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jsdoc: multiline description @property

I am documenting my code using jsdoc, so far so good, I have a comment like below

...
* @property {string}  mode -  mode of display 'video' - display video or 'audio' - play only the audio.
* @property...

and it comes in html document like

| ...   |         |                                 
| mode  | string  | mode of display 'video' - display video or 'audio' - play only the audio.|
| ...   |         |                                 

I want it to appear something like

| ...   |         |                                 |
| mode  | string  | mode of display                 |
|       |         |   'video' - display video       |
|       |         |   'audio' - play only the audio.|
| ...   |         |                                 |

hope I am making myself clear...

like image 549
mido Avatar asked Feb 26 '15 02:02

mido


4 Answers

for this you can simply add two line spaces instead of one for example:

this

/**
 * decription
 * modes:
 * I am foo
 * I am bar
 */

results to :

decription modes: I am foo I am bar

But

this

 /**
 * decription
 * 
 * modes:
 * 
 * I am foo
 * 
 * I am bar
 * 
 */

results to :

decription

modes:

I am foo

I am bar

like image 90
F4RZ1N Avatar answered Oct 29 '22 17:10

F4RZ1N


By using a minus sign you can avoid <br> (moreover not working in vscode)

  /**
   * @property {String} editMode editing mode
   * - A: description for A
   * - B: description for B
   * - C: description for C
   */

getting a bullet list:

enter image description here

like image 31
ʞᴉɯ Avatar answered Oct 29 '22 16:10

ʞᴉɯ


/**
 * @property {String} mode mode of display
 * <br>&nbsp;&nbsp;`video` - display video, or
 * <br>&nbsp;&nbsp;`audio` - plays only the audio
 * @property...
 */

Actual output:

enter image description here

like image 32
caffeinatedbits Avatar answered Oct 29 '22 17:10

caffeinatedbits


You have to use br-Tags to resolve new new lines:

mode of display <br>&nbsp;&nbsp; 'video' - display video <br>&nbsp;&nbsp; 'audio' - play only the audio. 
like image 5
Marvin Emil Brach Avatar answered Oct 29 '22 15:10

Marvin Emil Brach