mirror of
https://github.com/jsdoc/jsdoc.git
synced 2025-12-08 19:46:11 +00:00
Added support for @copyright tag.
This commit is contained in:
parent
b5266d765b
commit
0ff5df9193
@ -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
|
||||
|
||||
6
test/cases/copyrighttag.js
Normal file
6
test/cases/copyrighttag.js
Normal file
@ -0,0 +1,6 @@
|
||||
/** @constructor
|
||||
@copyright (c) 2011 Michael Mathews
|
||||
*/
|
||||
function Thingy() {
|
||||
|
||||
}
|
||||
@ -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();
|
||||
|
||||
11
test/t/cases/copyrighttag.js
Normal file
11
test/t/cases/copyrighttag.js
Normal 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');
|
||||
});
|
||||
|
||||
})();
|
||||
Loading…
x
Reference in New Issue
Block a user