Sha256: af3f8b46a3394a332c4af8fcf95877322bb97b88f27329b63d6b50bf40ef5ded
Contents?: true
Size: 604 Bytes
Versions: 5
Compression:
Stored size: 604 Bytes
Contents
var fs = require('fs'); var page = require('webpage').create(); var system = require('system'); var args = system.args; var scriptDir = args[0].replace(/googlecharts-convert\.js$/,'') var config = fs.read(args[1]) var pageContent = fs.read(scriptDir + 'template.html') pageContent = pageContent.replace(/\$\{CONFIG}/g, config); var path = args[1] + '.html'; fs.write(path, pageContent, 'w'); page.viewportSize = { width: 1024, height: 768 }; page.open(args[1] + '.html', function() { window.setTimeout(function () { page.render(args[2]); phantom.exit(); }, 1000); });
Version data entries
5 entries across 5 versions & 1 rubygems