X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=docs.js;h=c0b6f267cec145375c37b805515713ba9a7314ff;hb=fd04ff39427341348498b0cfd68d9b633e92ec44;hp=f9d64a70a7602d761b860ec27e58fe45c6776f9e;hpb=8f2e724edb41cedce953b9218749605afaa5912f;p=gnome.introspection-doc-generator diff --git a/docs.js b/docs.js index f9d64a7..c0b6f26 100644 --- 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 = []; @@ -62,6 +78,7 @@ ns_list.forEach(function(ns_name) var ns = Introspect.ns(ns_name); + // gir goes in top level... if (File.exists(ns.gir_file)) { File.copyFile(ns.gir_file, outputdir + '/'+ ns.gir_filename, Gio.FileCopyFlags.OVERWRITE); } @@ -69,11 +86,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.name+ '/' +ns_name + '.html', lang.cls_template.process(ns)); + + // left bar index of elements in namespace... + Gio.simple_write(outputdir + '/'+ lang.name + '/_ix_'+ ns_name + '.shtml', lang.cls_ix_template.process(ns)); + + }); var actions = { @@ -88,17 +108,16 @@ ns_list.forEach(function(ns_name) // we flag GLib as a GObject lib... idx[i]= ns_name == 'GLib' ? 1 : ns[i].length ; ns[i].forEach( function(n) { - - - Gio.simple_write(outputdir + '/'+ ns_name + '.' + n + '.html', - cls_template.process( - XObject.extend( - Introspect.factory(actions[i], ns_name, n), - { 'left_bar' :ns['left_bar'] } - ) + var odata = XObject.extend( + Introspect.factory(actions[i], ns_name, n), + { 'left_bar' :ns['left_bar'] } + ) + langs.forEach(function(lang) { + + Gio.simple_write(outputdir + '/'+ lang.name + '/' + ns_name + '.' + n + '.html', + lang.cls_template.process(odata) ) - ) - + }); console.log(ns_name + '.' +n); }); }