Added support for the @ignore tag.

This commit is contained in:
Michael Mathews 2011-01-15 22:16:59 +00:00
parent 71e60860d9
commit 41b626ce88
5 changed files with 28 additions and 1 deletions

View File

@ -159,7 +159,7 @@ function main() {
require('jsdoc/src/handlers').attachTo(app.jsdoc.parser);
docs = app.jsdoc.parser.parse(sourceFiles, env.opts.encoding);
dump(docs); exit(0);
//dump(docs); exit(0);
if (env.opts.expel) {
dump(docs);
exit(0);

View File

@ -171,6 +171,15 @@
}
});
dictionary.defineTag('ignore', {
mustNotHaveValue: true,
onTagged: function(doclet, tag) {
doclet.ignore = true;
return true;
}
});
dictionary.defineTag('inner', {
onTagged: function(doclet, tag) {
setDocletScopeToTitle(doclet, tag);

6
test/cases/ignoretag.js Normal file
View File

@ -0,0 +1,6 @@
/**
@ignore
*/
function foo(x) {
}

View File

@ -95,6 +95,7 @@ testFile('test/t/cases/copyrighttag.js');
testFile('test/t/cases/deprecatedtag.js');
testFile('test/t/cases/exceptiontag.js');
testFile('test/t/cases/globaltag.js');
testFile('test/t/cases/ignoretag.js');
report();

11
test/t/cases/ignoretag.js Normal file
View File

@ -0,0 +1,11 @@
(function() {
var docSet = testhelpers.getDocSetFromFile('test/cases/ignoretag.js'),
foo = docSet.getByLongname('foo')[0];
//dump(docSet.doclets);
test('When a symbol has an @ignore tag, the doclet has a ignore property set to true.', function() {
assert.equal(foo.ignore, true);
});
})();