Added support for @copyright tag.

This commit is contained in:
Michael Mathews 2011-01-15 11:29:44 +00:00
parent b5266d765b
commit 0ff5df9193
4 changed files with 33 additions and 6 deletions

View File

@ -31,6 +31,16 @@
}
});
dictionary.defineTag('augments', {
mustHaveValue: true,
onTagged: function(doclet, tag) {
doclet.augment(tag.value);
return false;
}
})
.synonym('extends');
dictionary.defineTag('borrows', {
mustHaveValue: true,
onTagged: function(doclet, tag) {
@ -42,15 +52,14 @@
.synonym('extends')
.synonym('mixes');
dictionary.defineTag('augments', {
mustHaveValue: true,
dictionary.defineTag('copyright', {
musHaveValue: true,
onTagged: function(doclet, tag) {
doclet.augment(tag.value);
doclet.copyright = tag.value;
return false;
return true;
}
})
.synonym('extends');
});
dictionary.defineTag('class', {
onTagged: function(doclet, tag) { // @class implies @constructor

View File

@ -0,0 +1,6 @@
/** @constructor
@copyright (c) 2011 Michael Mathews
*/
function Thingy() {
}

View File

@ -91,6 +91,7 @@ testFile('test/t/cases/alias2.js');
testFile('test/t/cases/accesstag.js');
testFile('test/t/cases/authortag.js');
testFile('test/t/cases/copyrighttag.js');
testFile('test/t/cases/globaltag.js');
report();

View File

@ -0,0 +1,11 @@
(function() {
var docSet = testhelpers.getDocSetFromFile('test/cases/copyrighttag.js'),
Thingy = docSet.getByLongname('Thingy')[0];
//dump(docSet.doclets);
test('When a symbol has a @copyright tag, the doclet has a copyright property with that value.', function() {
assert.equal(Thingy.copyright, '(c) 2011 Michael Mathews');
});
})();