X-Git-Url: http://git.roojs.org/?p=gnome.introspection-doc-generator;a=blobdiff_plain;f=JSDOC%2FBuildDocs.js;h=8c8552e39bd43923087604ce4316791c25743863;hp=9a8619c7bc4bdae6536a2011babdd2334fece1fa;hb=HEAD;hpb=2719b2bc5914e070768b131637c638cea9485f08 diff --git a/JSDOC/BuildDocs.js b/JSDOC/BuildDocs.js index 9a8619c..8c8552e 100644 --- a/JSDOC/BuildDocs.js +++ b/JSDOC/BuildDocs.js @@ -115,9 +115,6 @@ BuildDocs = { var srcFile = this.srcFiles[i]; - Options.LOG.inform("reading i : " + i + " length : " + this.srcFiles.length); - - var cacheFile = !Options.cacheDirectory.length ? false : Options.cacheDirectory + srcFile.replace(/\//g, '_') + ".cache"; @@ -268,8 +265,8 @@ BuildDocs = { function isaFile($) { return ($.is("FILE")) } - function isaClass($) { - return ($.is("CONSTRUCTOR") || $.isNamespace); + function isaClass($) { + return ($.is("CONSTRUCTOR") || $.isNamespace || $.isClass); } @@ -290,6 +287,7 @@ BuildDocs = { var targetDir = Options.target + "/symbols/src/"; this.makeSrcFile(file, targetDir); } + //print(JSON.stringify(symbols,null,4)); var classes = symbols.filter(isaClass).sort(makeSortby("alias")); @@ -388,12 +386,17 @@ BuildDocs = { var p =''; for(var i =0; i < cfgProperties.length;i++) { p = cfgProperties[i]; - props.push( { + var add = { name : p.name, type : p.type, desc : p.desc, + memberOf : p.memberOf == data.alias ? '' : p.memberOf - }); + } + if (p.optvalues) { + add.optvals = p.optvalues; + } + props.push(add ); } @@ -413,6 +416,24 @@ BuildDocs = { desc : m.desc }); } + + var ownMethods = data.methods.filter( function(e){ + return !e.isEvent && !e.comment.getTag('hide').length; + }).sort(makeSortby("name")); + + + var methods = []; + + for(var i =0; i < ownMethods.length;i++) { + m = ownMethods[i]; + methods.push( { + name : m.name, + sig : this.makeMethodSkel(m.params), + type : 'function', + desc : m.desc + }); + } + //println(props.toSource()); // we need to output: //classname => { @@ -423,7 +444,8 @@ BuildDocs = { var ret = { props : props, - events: events + events: events, + methods : methods, }; return ret; @@ -475,8 +497,17 @@ BuildDocs = { } ).map( function($) { return $.name == 'this' ? '_self' : $.name; } ).join(", ") + ")\n{\n\n}"; + }, + makeMethodSkel :function(params) { + if (!params) return "()"; + return "(" + + params.filter( + function($) { + return $.name.indexOf(".") == -1; // don't show config params in signature + } + ).map( function($) { return $.type + " " +( $.name == 'this' ? '_self' : $.name ); } ).join(", ") + + ")"; } - };