/trunk/jsdoc-toolkit/app/plugins/commentSrcJson.js
JavaScript | 20 lines | 18 code | 1 blank | 1 comment | 2 complexity | 49bc2d4ee300fd289003c11425b6681f MD5 | raw file
1JSDOC.PluginManager.registerPlugin(
2 "JSDOC.commentSrcJson",
3 {
4 onDocCommentSrc: function(comment) {
5 var json;
6 if (/^\s*@json\b/.test(comment)) {
7 comment.src = new String(comment.src).replace("@json", "");
8
9 eval("json = "+comment.src);
10 var tagged = "";
11 for (var i in json) {
12 var tag = json[i];
13 // todo handle cases where tag is an object
14 tagged += "@"+i+" "+tag+"\n";
15 }
16 comment.src = tagged;
17 }
18 }
19 }
20);