2013-04-30 14 views
3

我試圖用yuidoc(http://yui.github.io/yuidoc/)來記錄我的node.js模塊,我想知道如何創建從param到其實現的鏈接。Yuidoc:指定參數的性質

比方說,我有以下src/core/Repo.js

/** 
* Repo 
* @class Repo 
* @module core 
*/ 
var Repo = function() { 
    /** 
    * Insert stuff 
    * @param {Object} obj - some stuff 
    * @param {Function} callback - error/success callback 
    */ 
    var _insert() = function(obj, callback) { 
    } 
    return { 
    insert : _insert 
    } 
} 
module.exports = Repo; 

而一個src/routing/Routes.js

/** 
* Routes 
* @class Routes 
* @module routing 
* @param {Repo} repo - the repo object (from repo.js) 
*/ 
var Routes = function(repo) { 
} 
modules.exports = Routes; 

我如何告訴Routes功能在參數需要Repo對象,以便有yuidoc生成正確的超鏈接在HTML文檔? (上面的代碼似乎不起作用)

回答

1

因此,添加@constructor標籤很簡單!像這樣:

/** 
* Routes 
* @class Routes 
* @constructor 
* @module routing 
* @param {Repo} repo - the repo object 
*/ 
var Routes = function(repo) { 
} 
modules.exports = Routes;