JSDOC/BuildDocs.js
[gnome.introspection-doc-generator] / JSDOC / BuildDocs.js
index 6499225..f9beecf 100644 (file)
@@ -31,18 +31,13 @@ BuildDocs = {
     
     srcFiles : [],
     
-    build : function (opts)
+    build : function ()
     {
-        
-        XObject.extend(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)) {   
             File.mkdir(Options.cacheDirectory)
@@ -151,7 +146,7 @@ BuildDocs = {
         
         
         Parser.finish();
-    }
+    },
     
      
         
@@ -281,7 +276,7 @@ BuildDocs = {
         
     },
 
-    publishJSON = function(file, data)
+    publishJSON : function(file, data)
     {
         // what we need to output to be usefull...
         // a) props..
@@ -341,18 +336,23 @@ BuildDocs = {
         
         
     },
-    makeSrcFile: function(path, srcDir, name) 
+    makeSrcFile: function(sourceFile) 
     {
-        if (Options.outputSource) return;
         
-      
-        if (!name) {
-            name = path.replace(/\.\.?[\\\/]/g, "").replace(/[\\\/]/g, "_");
-            name = name.replace(/\:/g, "_");
-        }
         
-         var pretty = PrettyPrint.toPretty(str);
+        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, 
+            '<html><head>' +
+            '<title>' + sourceFile + '</title>' +
+            '<link rel="stylesheet" type="text/css" href="../../../highlight-js.css"/>' + 
+            '</head><body class="highlightpage">' +
+            pretty +
+            '</body></html>');
     }