【发布时间】:2017-11-05 19:52:57
【问题描述】:
/**
* Displays the list of autolab commands along with their functions.
* @module lib/help
*/
var Table = require('cli-table');
var chalk = require('chalk');
var helpjson = {
'init' : 'Initializes local repository and authenticates',
'exit' : 'Wipes off the credentials from the system',
'git create' : 'Creates a repository on Gitlab',
'git delete' : 'Deletes the specified repository from Gitlab',
'git changeserver' : 'To change the host of Gitlab',
'git changelang' : 'To change the language of the code submission',
'git push' : 'Adds, commits, pushes the code',
'submit' : 'To submit the code to JavaAutolab and fetch the results',
'help' : 'Print help manual'
};
module.exports = function() {
/**
* Displays the list of autolab commands along with their functions.
* @function
* @param {null}
*/
console.log('\n' + chalk.blue('Usage:') + ' autolab [OPTIONS]');
var table = new Table({
head: ['Options:', ''],
colWidths: [20,70]
});
for (var key in helpjson)
table.push(
[key,helpjson[key]]
);
console.log(table.toString());
};
我试过了,但是 html 页面只显示 lib/help,然后是一个空白页面。我还想使用@exports 来提及模块导出的内容。还有一种方法可以在 JSDoc 中记录对象的用途和概述。
【问题讨论】:
标签: documentation jsdoc jsdoc3