Commit | Line | Data |
---|---|---|
1 | JSDOC.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 | ); |