f15gdsy / electron-jade

Simple electron protocol to compile Jade files on the fly

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

electron jade

This module is a simple protocol handler for electron which takes care of all URLs with jade scheme. It compiles .jade files on the fly and the rest of the requests are just handles as simple (local) file requests.

Neutron Compatible

Installation

npm install electron-jade

Usage

Just initialize this module with desired options for Jade package after the main BrowserWindow is created:

'use strict';

var app = require('app');
var j = require('./util/jade-protocol.js')({pretty: true});
var BrowserWindow = require('browser-window');

// Standard stuff

app.on('ready', function () {
  mainWindow = new BrowserWindow({ width: 800, height: 600 });

  mainWindow.loadUrl('jade://' + __dirname + '/index.jade');
  // the rest...
});

Disclaimer: this module is in its very early stages and the logic is still not mature enough.

Even more!

If you want to have least effort when developing electron packages, take a look at neutron!

About

Simple electron protocol to compile Jade files on the fly


Languages

Language:JavaScript 100.0%