PageRenderTime 144ms CodeModel.GetById 130ms RepoModel.GetById 0ms app.codeStats 0ms

/tags/jsdoc_toolkit-2.3.2/jsdoc-toolkit/app/plugins/commentSrcJson.js

http://jsdoc-toolkit.googlecode.com/
JavaScript | 20 lines | 18 code | 1 blank | 1 comment | 2 complexity | 49bc2d4ee300fd289003c11425b6681f MD5 | raw file
  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. eval("json = "+comment.src);
  9. var tagged = "";
  10. for (var i in json) {
  11. var tag = json[i];
  12. // todo handle cases where tag is an object
  13. tagged += "@"+i+" "+tag+"\n";
  14. }
  15. comment.src = tagged;
  16. }
  17. }
  18. }
  19. );