docs.js
[gnome.introspection-doc-generator] / docs.js
diff --git a/docs.js b/docs.js
index f9d64a7..6af0dda 100644 (file)
--- a/docs.js
+++ b/docs.js
@@ -42,12 +42,28 @@ ns_list = ns_list.sort();
 
 
 // which languages do we want to output for.
+langs=[];
+File.list(__script_path__ + '/templates/').forEach(function(f) {
+    if (!File.isDirectory(__script_path__ + '/templates/' + f)) {
+        continue;
+    }
+    if (f == 'resources') {
+        continue;
+    }
+    langs.push({
+        name : f,
+        cls_template       : new Template(__script_path__ + '/templates/' + f + '/class.html'),
+        cls_ix_template    : new Template(__script_path__ + '/templates/' + f + '/class_ix.html'),
+        reference_template : new Template(__script_path__ + '/templates/' + f + '/references.html'),
+    });
+});
 
 
+/*
 var cls_template = new Template(__script_path__ + '/templates/class.html');
 var cls_ix_template = new Template(__script_path__ + '/templates/class_ix.html');
 var reference_template = new Template(__script_path__ + '/templates/references.html');
-
+*/
 
 
 var ns_idx = [];
@@ -69,11 +85,14 @@ ns_list.forEach(function(ns_name)
     
     ns['left_bar'] = cls_ix_template.process(ns);
 
-    // namespace template
-    Gio.simple_write(outputdir + '/'+ ns_name +  '.html', cls_template.process(ns));
-    
-    // left bar index of elements in namespace...
-    Gio.simple_write(outputdir + '/_ix_'+ ns_name +  '.shtml', cls_ix_template.process(ns));
+    langs.forEach(function(lang) {
+        // namespace template
+        Gio.simple_write(outputdir + '/'+ lang + '/' +ns_name +  '.html', lang.cls_template.process(ns));
+        
+        // left bar index of elements in namespace...
+        Gio.simple_write(outputdir + '/'+ lang + '/_ix_'+ ns_name +  '.shtml', lang.cls_ix_template.process(ns));
+            
+    });
      
     
     var actions = {