-//var outputdir = '/home2/www/devel/seed';
-var outputdir = '/var/www/seed';
-
-// list namespace..
-//var ns_list = [ 'GIRepository' ];
-
-var ns_list = JSDOC.Introspect.namespaces().sort();
-//console.dump(ns_list);
- // ns_list = [ 'Gio' ];
-//ns_list = [ 'Gtk' ];
- /* 'Gdk',
- 'Gtk',
- 'GLib',
- 'Gio',
- 'GObject',
- 'GIRepository',
- 'Gst',
- 'Pango']
-*/
-var cls_list = [];
-
-var cls_template = new JSDOC.Template(__script_path__ + '/docs/class.html');
-var cls_ix_template = new JSDOC.Template(__script_path__ + '/docs/class_ix.tmpl');
-var reference_template = new JSDOC.Template(__script_path__ + '/docs/references.html');
-
-Roo.each(ns_list, function(ns_name) {
- var core;
- //if (ns_name == 'Epiphany') {
- // return;
- //}
- if (ns_name == 'GnomeGamesSupport') { // on gnome dev cd stuff.
+
+var outputdir = Seed.argv[2];
+
+if (!outputdir) {
+ throw {
+ name: "ArgumentError",
+ message: "No output directory specified on the command line\n" +
+ "Usage seed docs.js /var/www/seed [Gtk] \n"
+ };
+}
+
+
+if (!File.isDirectory(outputdir)) {
+ console.log("Creating directory " + outputdir);
+ File.mkdir(outputdir);
+};
+
+
+// Which libraries to build.
+
+var ns_list = NameSpace.namespaces();
+if (typeof(Seed.argv[3]) == 'string') {
+ console.log(Seed.argv.length);
+ ns_list = Seed.argv[3].split(',');
+}
+
+
+ns_list = ns_list.sort();
+// let's try and load them, so we find out early what will fail.
+ns_list.forEach(function(ns_name)
+{
+ var core = imports.gi[ns_name];
+});
+
+// which languages do we want to output for.
+langs=[];
+File.list(__script_path__ + '/templates/').forEach(function(f) {
+ if (!File.isDirectory(__script_path__ + '/templates/' + f)) {