Domanda

I'm trying to document my node.js modules with yuidoc (http://yui.github.io/yuidoc/) and i'm wondering how to create a link from a param to its implementation.

Let's say I have the following 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;

And a 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;

How do I tell the Routes function takes in param a Repo object in order to have yuidoc generate the right hyperlink in the html docs? (The snippet above doesn't seem to work)

È stato utile?

Soluzione

So, it's easy as adding @constructor tag! Like this:

/**
 * Routes
 * @class Routes
 * @constructor
 * @module routing
 * @param {Repo} repo - the repo object
 */
var Routes = function(repo) {
}
modules.exports = Routes;
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top