2014-07-23 9 views
5

JSDoc을 사용하여 jQuery 플러그인을 문서화하는 방법이 궁금하십니까? 내 코드는 다음과 같습니다JSDoc과 jQuery 플러그인 설명서

/** 
    * 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) { 
     // .. 
    } 

나는 @method$.fn.comments입니다 싶지만 동작하지 않습니다.

답변

5

당신이 경우에 @external를 사용해야합니다 JSDoc3 docs 주문에 따라 :

/** 
* 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 
*/