jsdoc: multiline description @property
Asked Answered
B

4

26

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...

Bernadettebernadina answered 26/2, 2015 at 2:9 Comment(4)
What have you tried so far? Post some examples of what got you to this point so that others have a jumping-off point and can better guide you.Isostasy
try to insert <br>-tags, this could work if they would not be escaped...Blessington
@Stonz2, this is more configuration related, searched the net without much luck, also I am quite new to jsdoc, not even sure what to try, and the source usejsdoc.org is not of much helpBernadettebernadina
@MarvinEmilBrach thx, mode of display <br>&nbsp&nbsp 'video' - display video <br>&nbsp&nbsp 'audio' - play only the audio. did the trick.Bernadettebernadina
B
5

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. 
Blessington answered 26/2, 2015 at 2:30 Comment(2)
This does not help avoid very long lines in the source file.Wandawander
@SzczepanHołyszewski: that was not the question... Feel free to add a answer which solves that problem as well or start a new question for it ;)Blessington
H
26

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

Heraldry answered 2/9, 2021 at 12:52 Comment(0)
G
15

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

Ginnygino answered 6/9, 2020 at 20:11 Comment(1)
The real answer right here.Stewpan
E
9
/**
 * @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

Eolande answered 15/3, 2019 at 5:57 Comment(0)
B
5

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. 
Blessington answered 26/2, 2015 at 2:30 Comment(2)
This does not help avoid very long lines in the source file.Wandawander
@SzczepanHołyszewski: that was not the question... Feel free to add a answer which solves that problem as well or start a new question for it ;)Blessington

© 2022 - 2024 — McMap. All rights reserved.