我已经建立了一个非常简单的项目来测试grunt (https://www.npmjs.org/package/grunt-ngdocs)。但是,当我尝试生成文档时,它无法识别任何注释。为什么?!帮助!
Gruntfile.js
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
ngdocs: {
options:{dest: 'docs'},
api:{
src:['someCode.js'],
title:'API Documentation'
}
}
});
// Load the plugin that provide tasks.
grunt.loadNpmTasks('grunt-ngdocs');
};someCode.js
/**
*
* This is a sample function
* @param x
* @returns {number}
*/
var myFunc = function(x){
return 2*x;
};控制台输出:
slc058:ngDocPlay selah$ grunt ngdocs
Running "ngdocs:api" (ngdocs) task
Generating Documentation...
DONE. Generated 0 pages in 7ms.
Done, without errors.发布于 2014-04-29 06:41:49
我将someCode.js修改为下面的代码,然后它就起作用了!
someCode.js
/**
* @ngdoc function
* @name myFunc
* @description
* This is a sample function
* @param {number} x - any number, don't matter which
*/
var myFunc = function(x){
return 2*x;
};https://stackoverflow.com/questions/23346067
复制相似问题