thirdparty/jsdoctoolkit/app/plugins/commentSrcJson.js
author Lennard de Rijk <ljvderijk@gmail.com>
Sun, 08 Nov 2009 11:54:44 -0800
changeset 3080 30a33926ab91
parent 3041 c8f47f0b6697
permissions -rw-r--r--
Fixed an error with the task_history not being loaded when it was empty.

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;
			}
		}
	}
);