mirror of
https://github.com/jsdoc/jsdoc.git
synced 2025-12-08 19:46:11 +00:00
Added support for the @see tag.
This commit is contained in:
parent
dd990a434c
commit
176205c398
@ -327,6 +327,16 @@
|
||||
})
|
||||
.synonym('return');
|
||||
|
||||
dictionary.defineTag('see', {
|
||||
mustHaveValue: true,
|
||||
onTagged: function(doclet, tag) {
|
||||
if (!doclet.see) { doclet.see = []; }
|
||||
doclet.see.push(tag.value);
|
||||
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
dictionary.defineTag('since', {
|
||||
mustHaveValue: true,
|
||||
onTagged: function(doclet, tag) {
|
||||
|
||||
11
test/cases/seetag.js
Normal file
11
test/cases/seetag.js
Normal file
@ -0,0 +1,11 @@
|
||||
/**
|
||||
* @see #search
|
||||
*/
|
||||
function foo() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @see http://example.com/someref
|
||||
*/
|
||||
function bar() {
|
||||
}
|
||||
@ -98,6 +98,7 @@ testFile('test/t/cases/globaltag.js');
|
||||
testFile('test/t/cases/ignoretag.js');
|
||||
testFile('test/t/cases/paramtag.js');
|
||||
testFile('test/t/cases/returnstag.js');
|
||||
testFile('test/t/cases/seetag.js');
|
||||
testFile('test/t/cases/sincetag.js');
|
||||
testFile('test/t/cases/typetag.js');
|
||||
testFile('test/t/cases/versiontag.js');
|
||||
|
||||
15
test/t/cases/seetag.js
Normal file
15
test/t/cases/seetag.js
Normal file
@ -0,0 +1,15 @@
|
||||
(function() {
|
||||
var docSet = testhelpers.getDocSetFromFile('test/cases/seetag.js'),
|
||||
foo = docSet.getByLongname('foo')[0],
|
||||
bar = docSet.getByLongname('bar')[0];
|
||||
|
||||
//dump(docSet.doclets); exit(0);
|
||||
|
||||
test('When a symbol has an @see tag, the doclet has a see property that includes that value.', function() {
|
||||
assert.equal(typeof foo.see, 'object');
|
||||
assert.equal(foo.see[0], '#search');
|
||||
|
||||
assert.equal(typeof bar.see, 'object');
|
||||
assert.equal(bar.see[0], 'http://example.com/someref');
|
||||
});
|
||||
})();
|
||||
Loading…
x
Reference in New Issue
Block a user