jsdoc-to-markdown icon indicating copy to clipboard operation
jsdoc-to-markdown copied to clipboard

Classes: examples don't show up unless a description is present?

Open ambischof opened this issue 8 years ago • 7 comments

Probably because the example is put in the same section as the description, but if the description is not set, the example doesn't show up.

ambischof avatar Mar 17 '16 19:03 ambischof

can you post some code i can use to reproduce, please

75lb avatar Mar 17 '16 19:03 75lb

/**
 * @class Storage
 * @classdesc
 * An app wide storage/state persistence solution with direct and radio connectivity.
 * Can be accessed:
 * * directly through the instance via member functions,
 * * through the radio channel "storage"
 *
 * Typically it's probably better to access through the radio, so that there's no need to have a reference to app.
 *
 * **Note: There can only be one instance of this class.** Because there can only be one instance of the "storage" radio channel.
 *
 * Radio Handles:
 * * "set:item" -> radio proxy for setItem (same parameters)
 * * "get:item" -> radio proxy for getItem (same parameters and return)
 *
 * @todo Use localStorage or sessionStorage
 * @todo Further consider the identifier scheme for pages. Right now pages use their url, but it may not be the best way?
 * @example
 * app.storage = new Storage();
 *
 * app.storage.setItem('userdashboard', 'foo', 'bar');
 * app.storage.getItem('userdashboard', foo);
 * // -> "bar"
 *
 * //same result as above.
 * Backbone.Radio.channel('storage').trigger('set:item', 'userdashboard', 'foo', 'bar');
 * Backbone.Radio.channel('storage').request('get:item', 'userdashboard', 'foo');
 * // -> "bar"
 */

If you add a line or two at the top for the description, the example is rendered as expected.

ambischof avatar Mar 17 '16 19:03 ambischof

ok, i see it now.. thanks - will look in the morning..

75lb avatar Mar 17 '16 21:03 75lb

In my case @example doesn't show up even if the description is set.

mkhazov avatar Jul 19 '16 05:07 mkhazov

You need @method see this https://github.com/ctumolosus/jsdoc-babel/issues/1

danielyaa5 avatar Sep 12 '17 02:09 danielyaa5

@danielyaa5 I don't think that's relevant for this issue. Besides, @method is short for @type method and @class is short for @type class. It wouldn't make sense to use that.

ambischof avatar Sep 12 '17 02:09 ambischof

Could you check whether this issue is resolved by jsdoc2md v5.0.0 please?

75lb avatar May 12 '19 18:05 75lb