mirror of
https://github.com/jsdoc/jsdoc.git
synced 2025-12-08 19:46:11 +00:00
support the fileoverview tag in the Closure Compiler dictionary (#605)
This commit is contained in:
parent
afe7c3564a
commit
adf742615e
@ -871,6 +871,15 @@ exports.closureTags = {
|
|||||||
onTagged: ignore
|
onTagged: ignore
|
||||||
},
|
},
|
||||||
extends: cloneTagDef(baseTags.augments),
|
extends: cloneTagDef(baseTags.augments),
|
||||||
|
fileoverview: {
|
||||||
|
onTagged: function(doclet, tag) {
|
||||||
|
setNameToFile(doclet);
|
||||||
|
doclet.kind = 'file';
|
||||||
|
setDocletDescriptionToValue(doclet, tag);
|
||||||
|
|
||||||
|
doclet.preserveName = true;
|
||||||
|
}
|
||||||
|
},
|
||||||
final: cloneTagDef(baseTags.readonly),
|
final: cloneTagDef(baseTags.readonly),
|
||||||
implements: cloneTagDef(baseTags.implements),
|
implements: cloneTagDef(baseTags.implements),
|
||||||
inheritdoc: cloneTagDef(baseTags.inheritdoc),
|
inheritdoc: cloneTagDef(baseTags.inheritdoc),
|
||||||
|
|||||||
3
test/fixtures/fileoverviewtag.js
vendored
Normal file
3
test/fixtures/fileoverviewtag.js
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
/**
|
||||||
|
* @fileoverview Overview of this file.
|
||||||
|
*/
|
||||||
28
test/specs/tags/fileoverviewtag.js
Normal file
28
test/specs/tags/fileoverviewtag.js
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
describe('@fileoverview tag', function() {
|
||||||
|
describe('JSDoc tags', function() {
|
||||||
|
// @fileoverview is a synonym of @file, so this is covered by the @file tag tests
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('Closure Compiler tags', function() {
|
||||||
|
var docSet = jasmine.getDocSetFromFile('test/fixtures/fileoverviewtag.js');
|
||||||
|
var fileDoc = docSet.getByLongname('[[string0]]')[0];
|
||||||
|
|
||||||
|
it('should set the doclet\'s name and longname to the file name', function() {
|
||||||
|
expect(fileDoc.name).toBe('[[string0]]');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should set the doclet\'s kind to `file`', function() {
|
||||||
|
expect(fileDoc.kind).toBe('file');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should use the value as a description', function() {
|
||||||
|
expect(fileDoc.description).toBe('Overview of this file.');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should set `preserveName` to `true`', function() {
|
||||||
|
expect(fileDoc.preserveName).toBe(true);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
5
test/specs/tags/filetag.js
Normal file
5
test/specs/tags/filetag.js
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
xdescribe('@file tag', function() {
|
||||||
|
// TODO: add tests
|
||||||
|
});
|
||||||
Loading…
x
Reference in New Issue
Block a user