Added support for @todo.

This commit is contained in:
Michael Mathews 2011-08-20 11:57:33 +01:00
parent b1f6ebf6d9
commit fc94a23f8c
4 changed files with 22 additions and 5 deletions

View File

@ -225,7 +225,7 @@ function main() {
require('jsdoc/borrow').resolveBorrows(docs);
if (env.opts.expel) {
if (env.opts.explain) {
console.log(docs);
exit(0);
}

View File

@ -18,14 +18,12 @@
argParser.addOption('t', 'template', true, 'The name of the template to use. Default: the "default" template');
argParser.addOption('c', 'configure', true, 'The path to the configuration file. Default: jsdoc __dirname + /conf.json');
argParser.addOption('e', 'encoding', true, 'Assume this encoding when reading all source files. Default: your system default encoding');
argParser.addOption('n', 'nocode', false, 'Ignore doclets that don\'t explicitly provide a symbol name.');
argParser.addOption('e', 'encoding', true, 'Assume this encoding when reading all source files. Default: utf-8');
argParser.addOption('T', 'test', false, 'Run all tests and quit.');
argParser.addOption('d', 'destination', true, 'The path to the output folder. Use "console" to dump data to the console. Default: console');
argParser.addOption('V', 'validate', false, 'Validate the results produced by parsing the source code.');
argParser.addOption('r', 'recurse', false, 'Recurse into subdirectories when scanning for source code files.');
argParser.addOption('h', 'help', false, 'Print this message and quit.');
argParser.addOption('X', 'expel', false, 'Dump all found doclet internals to console and quit.');
argParser.addOption('X', 'explain', false, 'Dump all found doclet internals to console and quit.');
argParser.addOption('q', 'query', true, 'Provide a querystring to define custom variable names/values to add to the options hash.');

View File

@ -419,6 +419,14 @@
}
});
dictionary.defineTag('todo', {
mustHaveValue: true,
onTagged: function(doclet, tag) {
if (!doclet.todo) { doclet.todo = []; }
doclet.todo.push(tag.value);
}
});
dictionary.defineTag('type', {
mustHaveValue: true,
canHaveType: true,

View File

@ -52,4 +52,15 @@
?></ul>
</dd>
<?js } ?>
<?js if (this.todo && todo.length) {?>
<dt>To Do:</dt>
<dd>
<ul><?js
todo.forEach(function(t) {
print('<li>'+t+'</li>');
});
?></ul>
</dd>
<?js } ?>
</dl>