Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery plugin documentation with JSDoc

I'm wondering how to documenting jQuery plugin by using JSDoc? My code is:

   /**
     * The default configurations of comments
     * @typedef {Object} CommentConfig
     ...
     */

   /**
     * Show comments
     * @method comments
     * @version 1.0.1
     * @param {CommentConfig} options Configuration of comment
     */
    $.fn.comments = function (options) {
        // ..
    }

I want @method is $.fn.comments but it doesn't work.

like image 423
ducdhm Avatar asked Jul 23 '14 04:07

ducdhm


1 Answers

Acording to JSDoc3 docs you should use @external in your case:

/**
 * The jQuery plugin namespace.
 * @external "jQuery.fn"
 * @see {@link http://docs.jquery.com/Plugins/Authoring The jQuery Plugin Guide}
 */

/**
 * Show comments
 * @function external:"jQuery.fn".comments
 */
like image 147
Lesha Ogonkov Avatar answered Oct 20 '22 18:10

Lesha Ogonkov