reagent/bin/gen-site.js
Dan Holmsand bffbae231d Reorganize build, tests and doc site
Tests and doc site can now run without node, using only
"lein figwheel". Tests and site are then re-run automatically
whenever a source file changes.

The doc site is now generated into "outsite/public", and can be
copied into the "gh-pages" branch with "make build-gh-pages".

"make push-gh-pages" builds the doc site and pushes it upstream
to the gh-pages branch there.

Generation of html pages is now handled completely in
ClojureScript, loaded from "bin/gen-site.js".

Link handling is a bit simplified.
2014-11-29 18:30:24 +01:00

32 lines
684 B
JavaScript
Executable File

var cljsLoad = require("./cljs-load");
var srcFile = "outsite/public/js/main.js";
var outputDirectory = "outsite/public/js/out/";
var moduleName = "devsetup";
var beep = "\u0007";
var gensite = function () {
console.log("Loading " + srcFile);
var optNone = cljsLoad.load(srcFile, outputDirectory, moduleName);
sitetools.genpages({"opt-none": optNone});
}
var compileFail = function () {
var msg = process.argv[process.argv.length - 1];
if (msg && msg.match(/failed/)) {
console.log("Compilation failed" + beep);
return true;
}
};
if (!compileFail()) {
try {
gensite();
} catch (e) {
console.log(e + beep);
console.error(e.stack);
}
}