Skip to content

Commit

Permalink
feat(jsdoc): add '@type' tag
Browse files Browse the repository at this point in the history
Closes #33
  • Loading branch information
iqrow authored and petebacondarwin committed Apr 24, 2014
1 parent d7c2052 commit 904aa00
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ from jsdoc style comments in files.
* `tag-extractor` - extracts the tags information and converts it to specific properties on
the documents, based on a set of tag-definitions. The `jsdoc` package contains definitions for the
following tags: `name`, `memberof`, `param`, `property`, `returns`, `module`, `description`, `usage`,
`animations`, `constructor`, `class`, `classdesc`, `global`, `namespace` and `kind`.
`animations`, `constructor`, `class`, `classdesc`, `global`, `namespace`, `method`, `type` and `kind`.
* `nunjucks-renderer` - uses the Nunjucks template library to render the documents into files, such
as HTML or JS, based on templates.

Expand Down
10 changes: 10 additions & 0 deletions jsdoc/spec/tag-defs/tags.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,16 @@ describe('tag definitions', function() {

});

describe("type", function() {

it("should transform into a type object", function() {
var doc = parseDoc("@type {string}");
var tag = doc.tags.getTag('type');
var variable = doTransform(doc, tag);
checkProperty(variable, undefined, '', ['string']);
});

});

describe("returns/return", function() {

Expand Down
8 changes: 8 additions & 0 deletions jsdoc/tag-defs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,14 @@ module.exports = [
}
},

{
name: 'type',
canHaveType: true,
transformFn: function(doc, tag) {
return tag;
}
},

{
name: 'requires',
multi: true
Expand Down

0 comments on commit 904aa00

Please sign in to comment.