-
Notifications
You must be signed in to change notification settings - Fork 263
How to doc
IagoLast edited this page Nov 16, 2017
·
2 revisions
This is a quick guide for adding documentation using JSDoc
The documentation for the v4 branch is accessible from this url: http://cartodb.github.io/cartodb.js/
The command npm run docs
generates the public API documentation in the docs\v4
directory. Only the comments tagged with @api will be included in the doc.
The command npm run docs:all
generates the private documentation in the docs\v4-internal
directory. All the comments in the code will be included in the doc.
/** This is a description of the foo function.*/
function foo() {
}
/** This is a description of the foo function.
* @api
*/
function foo() {
}
/**
* Represents a book.
* @constructor
*/
function Book(title, author) {
}
/**
* Represents a book.
* @param {string} title - The title of the book.
* @param {string} author - The author of the book.
*/
function book(title, author) {
}
var MyModel = Backbone.Model.extend(
/** @lends MyModel.prototype */
{
/**
* This is the model description
*
* @augments Backbone.Model
* @constructs
*/
initialize: function () {
},
/**
* My test method
* @memberof MyModel
* @method test
* @param {object} args description
* @return {number}
*/
test: function (args) {
}
}
);
var MyModel = Backbone.Model.extend(
/** @lends MyModel.prototype */
{
/**
* This is the model description
*
* @augments Backbone.Model
* @constructs
* @api
*/
initialize: function () {
},
/**
* My test method
* @memberof MyModel
* @method test
* @param {object} args description
* @return {number}
* @api
*/
test: function (args) {
}
}
);
-
Don
t use` final period in @param @returns -
use
final period in global descriptions and long paragraphs.