Marco Demaio Marco Demaio - 2 years ago 136
Javascript Question

JSDoc adding real code in documentation

Do you know if there is a some sort of <code> tag in JSDoc?
I need to add pieces of code in my documentation like this:

* This function does something see example below:
* var x = foo("test"); //it will show "test" message
* @param {string} str: string argumnet that will be shown in message
function foo(str)

I need the code in the comments to be displaied by JSDoc as code (if not sintax highlighetd, at least like preformatted or something with grey background)


Answer Source





This is whats used in many official docs, and will for instance receive syntax hightlighting with some tools

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download