carto/site/generate.js
Tom MacWright 6881fffea4 Do it.
2012-02-03 15:00:01 -05:00

20 lines
509 B
JavaScript

var fs = require('fs'),
path = require('path'),
_ = require('underscore');
function tmpl(x) {
return _.template(fs.readFileSync(path.join(__dirname, x), 'utf-8'));
}
var index = tmpl('index._');
var toc = tmpl('toc._');
var table = tmpl('symbolizers._');
var ref = JSON.parse(fs.readFileSync(path.join(__dirname, '../lib/carto/tree/reference.json'), 'utf8'));
fs.writeFileSync(path.join(__dirname, '../index.html'), index({
symbolizers: ref.symbolizers,
table: table,
toc: toc,
_: _
}));