Skip to content

Instantly share code, notes, and snippets.

@Carreau
Created April 19, 2014 20:04
Show Gist options
  • Select an option

  • Save Carreau/11095832 to your computer and use it in GitHub Desktop.

Select an option

Save Carreau/11095832 to your computer and use it in GitHub Desktop.
To build IPython Notebook themes. `node maketheme.js <variable.less> <output file>`
#!/usr/env node
var less = require('less')
var fs = require('fs');
var parser = new(less.Parser)({
paths : ['.','IPython/html/static/style/'],
filename: 'ipython.less'
});
var otherimp = process.argv[2];
var fullimport = "@import 'ipython';@import 'style' ; @import '"+otherimp+"';";
//console.log(fullimport);
parser.parse(fullimport, function(e, tree){
fs.writeFile(process.argv[3], tree.toCSS({compress: false}), function(err) {
if(err) {
console.log(err);
} else {
console.log("The file was saved!");
}
});
console.log();
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment