var can = f.resolve_relative_path('');
return can.get_path();
},
+
/**
* write
* @arg path {String} File to write to
var f = Gio.file_new_for_path(String(path));
return f['delete']();
},
- // copy files recursively from fromDir, silently ignore them if they already exist in toDir
- silentRecursiveCopy : function (fromDir, toDir) {
+ /**
+ * silentRecursiveCopy
+ * copy files recursively from fromDir, silently ignore them if they already exist in toDir
+ * unless you select overwrite..
+ * @arg {String} src source path
+ * @arg {String} dest destination path
+ * @arg {Gio.FileCopyFlags} options (optional) - use Gio.FileCopyFlags.OVERWRITE to
+ * otherwise they will not be copied
+ *
+ */
+ silentRecursiveCopy : function (fromDir, toDir, opts) {
+
var filesToCopy = File.recursiveListing(fromDir);
var srcPath, destPath, src, dest;
-
+ if (typeof(opts) =='undefined') {
+ opts = Gio.FileCopyFlags.NONE;
+ }
+
for (var index in filesToCopy) {
- srcPath = File.join(String(fromDir), filesToCopy[index]);
- destPath = File.join(String(toDir), filesToCopy[index]);
-
- if (File.isFile(srcPath) && !File.isFile(destPath)) {
- File.copyFile(srcPath, destPath);
- }
- else if (File.isDirectory(srcPath) && !File.isDirectory(destPath)) {
- File.mkdir(destPath);
- }
+ srcPath = File.join(String(fromDir), filesToCopy[index]);
+ destPath = File.join(String(toDir), filesToCopy[index]);
+ if (File.isDirectory(srcPath) && !File.isDirectory(destPath)) {
+ File.mkdir(destPath);
+ continue;
+ }
+ // source is not file..?!?!?
+ if (!File.isFile(srcPath)) {
+ continue;
+ }
+ if (File.isFile(destPath) && opts == Gio.FileCopyFlags.NONE) {
+ // do not overwrite.. - if file exists and we are not flaged to overwrite.
+ continue;
+ }
+
+ File.copyFile(srcPath, destPath, opts);
+
}
},
-
+
+ /**
+ * mkdir
+ * make a directory..
+ * @arg {String} dstPath directory to make
+ */
mkdir : function (destPath) {
var dest = Gio.file_new_for_path(String(destPath));
return dest.make_directory(null, null);
},
-
- copyFile : function (srcPath, destPath) {
+ /**
+ * copyFile
+ * @arg {String} src source path
+ * @arg {String} dest destination path
+ * @arg {Gio.FileCopyFlags} options (optional) - use Gio.FileCopyFlags.OVERWRITE to .. overwrite..
+ *
+ */
+ copyFile : function (srcPath, destPath, opts) {
+ if (typeof(opts) =='undefined') {
+ opts = Gio.FileCopyFlags.NONE;
+ }
var dest = Gio.file_new_for_path(String(destPath));
var src = Gio.file_new_for_path(String(srcPath));
// a bit of a hack for the fact that Gio.File.copy arguments
// can be nulled, but not according to the GIR file
- return src.copy(dest, Gio.FileCopyFlags.NONE);
+ return src.copy(dest, opts);
},
recursiveListing : function (dir) {
imports['Object.js'].load(Object);
console = imports['console.js'].console;
-JSDOC = imports['JSDOC.js'].JSDOC;
+
xnew = imports['xnew.js'].xnew;
continue;
}
}
+
+
+ var gi = GI.IRepository.get_default();
+ var ver = gi.get_version(ns);
+ var pth = GI.IRepository.get_search_path ();
+ var gir_path = pth[0].replace(/lib\/girepository-1.0/, 'share\/gir-1.0');
+ //console.log(fn);
+ ret.gir_file = gir_path + '/'+ ns + '-' + ver + '.gir';
+ ret.gir_filename = ns + '-' + ver + '.gir';
+
//console.dump(this.ifaceList);
return ret;
imports['Object.js'].load(Object);
console = imports['console.js'].console;
-JSDOC = imports['JSDOC.js'].JSDOC;
+
Introspect = imports['JSDOC/Introspect.js'].Introspect;
Basic = imports['JSDOC/Introspect/Basic.js'].Basic;
this.desc = Introspect.doc(this.alias );
+ var gi = GI.IRepository.get_default();
+ var ver = gi.get_version(ns);
+ var pth = GI.IRepository.get_search_path ();
+ var gir_path = pth[0].replace(/lib\/girepository-1.0/, 'share\/gir-1.0');
+ //console.log(fn);
+ this.gir_file = gir_path + '/'+ ns + '-' + ver + '.gir';
+ this.gir_filename = ns + '-' + ver + '.gir';
+
+
},
Basic,
{
imports['Object.js'].load(Object);
console = imports['console.js'].console;
-JSDOC = imports['JSDOC.js'].JSDOC;
Introspect = imports['JSDOC/Introspect.js'].Introspect;
imports['Object.js'].load(Object);
console = imports['console.js'].console;
-JSDOC = imports['JSDOC.js'].JSDOC;
+
Introspect = imports['JSDOC/Introspect.js'].Introspect;
Basic = imports['JSDOC/Introspect/Basic.js'].Basic;
imports['Object.js'].load(Object);
console = imports['console.js'].console;
-JSDOC = imports['JSDOC.js'].JSDOC;
+
Introspect = imports['JSDOC/Introspect.js'].Introspect;
imports['Object.js'].load(Object);
console = imports['console.js'].console;
-JSDOC = imports['JSDOC.js'].JSDOC;
+
imports['Object.js'].load(Object);
console = imports['console.js'].console;
-JSDOC = imports['JSDOC.js'].JSDOC;
+
imports['Object.js'].load(Object);
console = imports['console.js'].console;
-JSDOC = imports['JSDOC.js'].JSDOC;
+
Introspect = imports['JSDOC/Introspect.js'].Introspect;
imports['Object.js'].load(Object);
console = imports['console.js'].console;
-JSDOC = imports['JSDOC.js'].JSDOC;
+
Introspect = imports['JSDOC/Introspect.js'].Introspect;
imports['Object.js'].load(Object);
console = imports['console.js'].console;
-JSDOC = imports['JSDOC.js'].JSDOC;
+
Introspect = imports['JSDOC/Introspect.js'].Introspect;
Basic = imports['JSDOC/Introspect/Basic.js'].Basic;
imports['Object.js'].load(Object);
console = imports['console.js'].console;
-JSDOC = imports['JSDOC.js'].JSDOC;
+
Introspect = imports['JSDOC/Introspect.js'].Introspect;
imports['Object.js'].load(Object);
console = imports['console.js'].console;
-JSDOC = imports['JSDOC.js'].JSDOC;
+
Introspect = imports['JSDOC/Introspect.js'].Introspect;
console = imports['console.js'].console;
-JSDOC = imports['JSDOC.js'].JSDOC;
+
console = imports['console.js'].console;
-JSDOC = imports['JSDOC.js'].JSDOC;
+
Introspect = imports['JSDOC/Introspect.js'].Introspect;
imports['Object.js'].load(Object);
-JSDOC = imports['JSDOC.js'].JSDOC;
+
console = imports['console.js'].console;
xnew = imports['xnew.js'].xnew;
Link = imports['JSDOC/Template/Link.js'].Link;
this.parse();
}
-xnew.load(Template , 'JSDOC/Template');
+
Object.extend(Template.prototype , {
//<script type="text/javascript">
-JSDOC = imports['JSDOC.js'].JSDOC;
console = imports['console.js'].console;
var link = {linkPath: linkPath, linkText: linkText, fullLinkPath: fullLinkPath};
- if (typeof PluginManager != "undefined") {
- JSDOC.PluginManager.run("onSymbolLink", link);
- }
+ //if (typeof PluginManager != "undefined") {
+ // JSDOC.PluginManager.run("onSymbolLink", link);
+ //}
return "<a href=\""+link.fullLinkPath+"\""+target+">"+link.linkText+"</a>";
},
Gtk = imports.gi.Gtk;
Gio = imports.gi.Gio;
Gdk = imports.gi.Gdk;
+XObject = imports.XObject.XObject;
-imports['Object.js'].load(Object);
-File = imports['File.js'].File;
-JSDOC = imports['JSDOC.js'].JSDOC;
-console = imports['console.js'].console;
+
+File = imports.File.File;
+console = imports.console.console;
Introspect = imports['JSDOC/Introspect.js'].Introspect;
+Template = imports['JSDOC/Template.js'].Template;
+
var outputdir = Seed.argv[2];
-var ns_list = JSDOC.Introspect.namespaces();
+var ns_list = Introspect.namespaces();
if (typeof(Seed.argv[3]) == 'string') {
console.log(Seed.argv.length);
ns_list = Seed.argv[3].split(',');
ns_list = ns_list.sort();
-var cls_template = new JSDOC.Template(__script_path__ + '/docs/class.html');
-var cls_ix_template = new JSDOC.Template(__script_path__ + '/docs/class_ix.html');
-var reference_template = new JSDOC.Template(__script_path__ + '/docs/references.html');
+var cls_template = new Template(__script_path__ + '/docs/class.html');
+var cls_ix_template = new Template(__script_path__ + '/docs/class_ix.html');
+var reference_template = new Template(__script_path__ + '/docs/references.html');
var ns_idx = [];
-ns_list.map(function(ns_name)
+ns_list.forEach(function(ns_name)
{
+
+ //if (ns_idx.length) { return ;/* do one - for testing */ }
+
var core = imports.gi[ns_name];
var idx = { name: ns_name};
console.log("START:" + ns_name);
var ns = Introspect.ns(ns_name);
+
+ if (File.exists(ns.gir_file)) {
+ File.copyFile(ns.gir_file, outputdir + '/'+ ns.gir_filename, Gio.FileCopyFlags.OVERWRITE);
+ }
+
+
ns['left_bar'] = cls_ix_template.process(ns);
Gio.simple_write(outputdir + '/'+ ns_name + '.html', cls_template.process(ns));
for (var i in actions) {
// we flag GLib as a GObject lib...
idx[i]= ns_name == 'GLib' ? 1 : ns[i].length ;
- ns[i].map( function(n) {
+ ns[i].forEach( function(n) {
Gio.simple_write(outputdir + '/'+ ns_name + '.' + n + '.html',
cls_template.process(
- Object.extend(
+ XObject.extend(
Introspect.factory(actions[i], ns_name, n),
{ 'left_bar' :ns['left_bar'] }
)
});
}
ns_idx.push(idx);
-
+
});
var refs = '';
}
-var ix_template = new JSDOC.Template(__script_path__ + '/docs/index.html');
+var ix_template = new Template(__script_path__ + '/docs/index.html');
Gio.simple_write(outputdir + '/index.html', ix_template.process(ns_idx));
-File.silentRecursiveCopy(__script_path__ + '/docs/resources/', outputdir);
-
-
-
+File.silentRecursiveCopy(__script_path__ + '/docs/resources/', outputdir, Gio.FileCopyFlags.OVERWRITE);
</tr>
</if>
<tr>
- <td class="label">Note:</td>
- <td class="hd-info"><b style="color:red">This documentation is generated from the HEAD of most
- libraries (and some experimental libs at times) - and may not be exactly the same as your
- installed .gir files - you may want to download the generator and install on your machine
- to find out what you have.<b/></td>
+ <td class="label">GIR File:</td>
+ <td class="hd-info"><a href="{+data.gir_filename+}">{+data.gir_filename+}</a></td>
</tr>
<tr>
<td class="label">C documentation:</td>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- <head>
- <meta http-equiv="content-type" content="text/html; charset=utf-8" />
- <title>Seed Documentation</title>
- <link rel="stylesheet" type="text/css" href="default.css" />
- <link rel="stylesheet" type="text/css" href="library_gnome.css"></link>
- <link media="print" rel="stylesheet" type="text/css" href="library_gnome_print.css"></link>
- </head>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="content-type" content="text/html; charset=utf-8" />
+ <title>Seed Documentation</title>
+ <link rel="stylesheet" type="text/css" href="default.css" />
+ <link rel="stylesheet" type="text/css" href="library_gnome.css"></link>
+ <link media="print" rel="stylesheet" type="text/css" href="library_gnome_print.css"></link>
+ </head>
- <body>
+ <body>
- <div id="page">
-
- <div id="header">
- <div id="header-wrap">
- <h1>Un-official Seed Documentation</h1>
- </div>
- </div>
- <div class="body-wrap">
+ <div id="page">
+
+ <div id="header">
+ <div id="header-wrap">
+ <h1>Un-official Seed Documentation</h1>
+ </div>
+ </div>
+ <div class="body-wrap">
- <div class="ns-list">
- <h2>GObject Libraries</h2>
- <for each="thisClass" in="data">
+ <div class="ns-list">
+ <h2>GObject Libraries</h2>
+ <for each="thisClass" in="data">
{!
if (!thisClass.objects) { continue; }
!}
- <div>
- <h2 class="classTitle">{+ (new Link().toSymbol(thisClass.name)) +}</h2>
- </div>
- </for>
- </div>
+ <div>
+ <h2 class="classTitle">{+ (new Link().toSymbol(thisClass.name)) +}</h2>
+ </div>
+ </for>
+ </div>
- <div class="ns-list">
+ <div class="ns-list">
- <h2>Non - GObject Libraries</h2>
- <for each="thisClass" in="data">
+ <h2>Non - GObject Libraries</h2>
+ <for each="thisClass" in="data">
{!
if (thisClass.objects) { continue; }
!}
- <div>
- <h2 class="classTitle">{+ (new Link().toSymbol(thisClass.name)) +}</h2>
- </div>
- </for>
+ <div>
+ <h2 class="classTitle">{+ (new Link().toSymbol(thisClass.name)) +}</h2>
+ </div>
+ </for>
</div>
- </div>
- </div>
-</body>
-</html>
-
-
+ </div>
+ </div>
+</body>
+</html>
+
+
\ No newline at end of file