thirdparty/jsdoctoolkit/app/plugins/commentSrcJson.js
author Sverre Rabbelier <srabbelier@gmail.com>
Mon, 02 Nov 2009 16:23:58 +0100
changeset 3073 6e100e194680
parent 3041 c8f47f0b6697
permissions -rw-r--r--
Convert gen_app_yaml.py to optparse This allows for example the -f flag to be specified as the second argument. Also add a '-i|--interactive' flag which asks for the application name interactively.

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