PrivateBin/jsdoc_toolkit-2.3.3-beta/app/plugins/commentSrcJson.js

20 lines
453 B
JavaScript
Raw Normal View History

2010-05-27 06:34:42 +08:00
JSDOC.PluginManager.registerPlugin(
"JSDOC.commentSrcJson",
{
onDocCommentSrc: function(comment) {
var json;
if (/^\s*@json\b/.test(comment)) {
comment.src = new String(comment.src).replace("@json", "");
eval("json = "+comment.src);
var tagged = "";
for (var i in json) {
var tag = json[i];
// todo handle cases where tag is an object
tagged += "@"+i+" "+tag+"\n";
}
comment.src = tagged;
}
}
}
);