X-Git-Url: http://git.roojs.org/?p=gnome.introspection-doc-generator;a=blobdiff_plain;f=JSDOC%2FBuildDocs.js;h=fac451dccc6c60443b1ee5720135e44a0bbc285b;hp=b55bc13152779a9248a8f58b3e54a4747ee8f0fe;hb=7e0c58e6c06915dad40a04b582612b60175c4fee;hpb=12b9dd48423ce2fb8b8a69c9a52a374be7e74580 diff --git a/JSDOC/BuildDocs.js b/JSDOC/BuildDocs.js index b55bc13..fac451d 100644 --- a/JSDOC/BuildDocs.js +++ b/JSDOC/BuildDocs.js @@ -10,7 +10,7 @@ File = imports.File.File; Template = imports.JsTemplate.Template.Template; -Options = imports.Options.Options; + Parser = imports.Parser.Parser; TokenReader = imports.TokenReader.TokenReader; @@ -21,7 +21,7 @@ Symbol = imports.Symbol.Symbol; // should not realy be here -- or anywhere...?? - +Options = false; // refer to this everywhere! BuildDocs = { @@ -31,20 +31,16 @@ BuildDocs = { srcFiles : [], + build : function (opts) { - - XObject.extend(Options, opts); - + Options = opts; Options.init(); - - - Options.LOG.inform("JsDoc Toolkit main() running at "+new Date()+"."); - Options.LOG.inform("With options: "); + //Options.LOG.inform("With options: "); - if (!File.isDirectory(Options.cacheDirectory)) { + if (Options.cacheDirectory.length && !File.isDirectory(Options.cacheDirectory)) { File.mkdir(Options.cacheDirectory) } @@ -151,7 +147,7 @@ BuildDocs = { Parser.finish(); - } + }, @@ -281,7 +277,7 @@ BuildDocs = { }, - publishJSON = function(file, data) + publishJSON : function(file, data) { // what we need to output to be usefull... // a) props.. @@ -341,18 +337,23 @@ BuildDocs = { }, - makeSrcFile: function(sourceFile, targetDir, name) + makeSrcFile: function(sourceFile) { - if (Options.outputSource) return; - - if (!name) { - name = sourceFile.replace(/\.\.?[\\\/]/g, "").replace(/[\\\/]/g, "_"); - name = name.replace(/\:/g, "_"); - } - var pretty = PrettyPrint.toPretty(sourceFile); + name = sourceFile.substring(Options.baseDir.length); + name = name.replace(/\.\.?[\\\/]/g, "").replace(/[\\\/]/g, "_"); + name = name.replace(/\:/g, "_"); //?? + + var pretty = imports.PrettyPrint.toPretty(File.read(sourceFile)); + File.write(Options.target+"/symbols/src/" + name, + '' + + '' + sourceFile + '' + + '' + + '' + + pretty + + ''); }