Permalink
Browse files

Fixed jake server start and documentation index.

  • Loading branch information...
1 parent 834d2d9 commit 9c6975306f9d7f48eacc97353120582b80afbfb9 @tehmou committed Mar 14, 2012
Showing with 48 additions and 32 deletions.
  1. +5 −10 Jakefile.js
  2. +40 −19 docs/js/docs/index.html
  3. +1 −1 src/public/game.html
  4. +2 −2 src/server.js
View
@@ -43,24 +43,19 @@
function processDir (dir, folder) {
var contents = fs.readdirSync(dir);
- var description = "", fileList = "";
+ var description = "", fileList;
contents.forEach(function (item) {
if (item === "lib") {
return;
}
var path = dir + "/" + item;
if (fs.statSync(path).isDirectory()) {
+ indexCoffee += "# " + path.replace("src/public/js/", "").replace(/\//g, ".") + "\n";
+ indexCoffee += "# --\n";
processDir(path, folder[item] = { _name: item });
} else {
- if (item === "namespace.coffee") {
- //description = "# " + folder._name + "\n";
- //description += "# --\n";
- //description += folder._description = ""+fs.readFileSync(path);
- } else {
- fileList += "# <a href=''>" + item + "</a><br />\n";
- }
folder[item] = "file";
- indexCoffee += description + fileList;
+ indexCoffee += "# <a href='" + item.replace(".coffee", "") + ".html'>" + item + "</a><br />\n";
// FIXME: Must wait!!!
@@ -74,7 +69,7 @@
desc("Run the local server at port given in first argument");
task("run-server", function (port) {
port = port === undefined ? 9876 : port;
- require("./src/server.js").open(port);
+ require("./src/server.js").open(port, "./src/public");
});
})();
View
@@ -1,21 +1,42 @@
-<!DOCTYPE html> <html> <head> <title>index.coffee</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> index.coffee </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> <p>LocalBroker.coffee<br />
-Central.coffee<br />
-Client.coffee<br />
-Client.coffee<br />
-clientUtils.coffee<br />
-InputShipController.coffee<br />
-InputShipController.coffee<br />
-KeyboardInput.coffee<br />
-PreRenderer.coffee<br />
-PreRenderer.coffee<br />
-Renderer.coffee<br />
-shipInputTypes.coffee<br />
-shipInputTypes.coffee<br />
-utils.coffee<br />
-define.coffee<br />
-Engine.coffee<br />
-World.coffee<br />
-Physics.coffee<br />
-define.coffee<br /></p> </td> <td class="code"> <div class="highlight"><pre>
+<!DOCTYPE html> <html> <head> <title>index.coffee</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> index.coffee </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> <h2>broker</h2>
+
+<p><a href='LocalBroker.html'>LocalBroker.coffee</a><br /></p>
+
+<h2>central</h2>
+
+<p><a href='Central.html'>Central.coffee</a><br /></p>
+
+<h2>client</h2>
+
+<p><a href='Client.html'>Client.coffee</a><br />
+<a href='clientUtils.html'>clientUtils.coffee</a><br /></p>
+
+<h2>client.input</h2>
+
+<p><a href='InputShipController.html'>InputShipController.coffee</a><br />
+<a href='KeyboardInput.html'>KeyboardInput.coffee</a><br /></p>
+
+<h2>client.rendering</h2>
+
+<p><a href='PreRenderer.html'>PreRenderer.coffee</a><br />
+<a href='Renderer.html'>Renderer.coffee</a><br /></p>
+
+<h2>common</h2>
+
+<p><a href='shipInputTypes.html'>shipInputTypes.coffee</a><br />
+<a href='utils.html'>utils.coffee</a><br />
+<a href='define.html'>define.coffee</a><br /></p>
+
+<h2>engine</h2>
+
+<p><a href='Engine.html'>Engine.coffee</a><br /></p>
+
+<h2>engine.model</h2>
+
+<p><a href='World.html'>World.coffee</a><br /></p>
+
+<h2>engine.physics</h2>
+
+<p><a href='Physics.html'>Physics.coffee</a><br /></p> </td> <td class="code"> <div class="highlight"><pre>
</pre></div> </td> </tr> </tbody> </table> </div> </body> </html>
View
@@ -18,7 +18,7 @@
<script src="js/lib/stats.js" type="text/javascript"></script>
<script src="js/lib/underscore.js" type="text/javascript"></script>
- <script src="js/luolis.js" type="text/javascript"></script>
+ <script src="js/define.js" type="text/javascript"></script>
<script src="js/broker/LocalBroker.js" type="text/javascript"></script>
View
@@ -13,10 +13,10 @@ var coffee = require("coffee-script"),
path = require("path"),
io = require('socket.io');
-var webroot = './public';
-exports.open = function (port) {
+exports.open = function (port, webroot) {
+ webroot = webroot || './public';
var app = express.createServer(),
ioApp = io.listen(app);

0 comments on commit 9c69753

Please sign in to comment.