Intial import
[gnome.introspection-doc-generator] / docs.js
1 //<Script type="text/javascript">
2
3 Gtk = imports.gi.Gtk;
4 Gio = imports.gi.Gio;
5 Gdk = imports.gi.Gdk;
6
7 imports['Array.js']; 
8 JSDOC   = imports['JSDOC.js'].JSDOC; 
9 console = imports['console.js'].console; 
10 Roo     = imports['Roo.js'].Roo; 
11
12 Introspect = imports['JSDOC/Introspect.js'].Introspect; 
13
14    
15
16 //var outputdir = '/home2/www/devel/seed';
17 var outputdir = '/var/www/seed';
18
19 // list namespace..
20 //var ns_list = [ 'GIRepository' ];
21
22 var ns_list = JSDOC.Introspect.namespaces().sort();
23 //console.dump(ns_list);
24  // ns_list = [ 'Gio' ];
25 //ns_list = [ 'Gtk' ];
26  /* 'Gdk',
27     'Gtk',  
28     'GLib',
29     'Gio',
30     'GObject',
31     'GIRepository',
32     'Gst',
33     'Pango']
34 */
35 var cls_list = [];
36
37 var cls_template = new JSDOC.Template(__script_path__ + '/docs/class.html');
38 var cls_ix_template = new JSDOC.Template(__script_path__ + '/docs/class_ix.tmpl');
39 var reference_template = new JSDOC.Template(__script_path__ + '/docs/references.html');
40
41 Roo.each(ns_list, function(ns_name) {
42     var core;
43     //if (ns_name == 'Epiphany') {
44      //   return;
45     //} 
46     if (ns_name == 'GnomeGamesSupport') { // on gnome dev cd stuff.
47         return;
48     }
49     
50     //try {
51         core = imports.gi[ns_name];
52     //} catch (e) {
53     //    Seed.print("SKIP (no import): "+ ns_name + ": " +  e);
54         
55     //    return;
56     //}
57     Seed.print("START:" + ns_name);
58     // ones that cause problems.
59     
60     
61     
62     // Namespace file..
63     var ns = Introspect.ns(ns_name);
64
65     Gio.simple_write(outputdir + '/'+ ns_name +  '.shtml', cls_template.process(ns));
66     cls_list.push({
67         alias : ns_name 
68     });
69     
70     // left bar index of elements in namespace...
71     Gio.simple_write(outputdir + '/_ix_'+ ns_name +  '.shtml', cls_ix_template.process(ns));
72      
73     // index...
74     
75     
76     Roo.each(ns.objects, function(n) {
77         
78         
79         Gio.simple_write(outputdir + '/'+ ns_name + '.' + n + '.shtml', 
80             cls_template.process( Introspect.factory('Class', ns_name, n)));
81  
82         Seed.print(ns_name + '.' +n);
83     });
84      Roo.each(ns.interfaces, function(n) {
85         
86         
87         Gio.simple_write(outputdir + '/'+ ns_name + '.' + n + '.shtml', 
88             cls_template.process( Introspect.factory('Interface', ns_name, n)));
89  
90         Seed.print(ns_name + '.' +n);
91     });
92     Roo.each(ns.structs, function(n) {
93         
94         
95         Gio.simple_write(outputdir + '/'+ ns_name + '.' + n + '.shtml', 
96             cls_template.process( Introspect.factory('Struct', ns_name, n)));
97         
98         
99         Seed.print(ns_name + '.' +n);
100     });
101     
102     Roo.each(ns.unions, function(n) {
103         
104         
105         Gio.simple_write(outputdir + '/'+ ns_name + '.' + n + '.shtml', 
106             cls_template.process( Introspect.factory('Union', ns_name, n)));
107         
108         
109         Seed.print(ns_name + '.' +n);
110     });
111     
112     Roo.each(ns.enums, function(n) {
113         
114         
115         Gio.simple_write(outputdir + '/'+ ns_name + '.' + n + '.shtml', 
116             cls_template.process( Introspect.factory('Enum', ns_name, n)));
117         
118         
119         Seed.print(ns_name + '.' +n);
120     });
121     
122 })
123
124 for (var i in Introspect.references) {
125     
126     console.log("REFERENCE: " + i + ' : ' + Introspect.references[i].length);
127     Gio.simple_write(outputdir + '/references.'+ i + '.html', 
128             reference_template.process( Introspect.references[i] ));
129        
130 }
131
132 var ix_template = new JSDOC.Template(__script_path__ + '/docs/index.tmpl');
133 Gio.simple_write(outputdir + '/index.shtml', ix_template.process(ns_list));
134
135
136