electron-pug-less
v1.0.0
Published
Simple electron module to render Pug & less templates
Downloads
3
Readme
electron pug
This module is a simple file
protocol interceptor for electron which compiles all (local) URLs to files with .pug
extension (e.g /home/electron-pug/index.pug
) on the fly.
Installation
npm install electron-pug
Usage
Just initialize this module with desired options for Pug package and your locals:
'use strict';
const {app, BrowserWindow} = require('electron');
const locals = {/* ...*/};
const pug = require('electron-pug')({pretty: true}, locals);
// Standard stuff
app.on('ready', () => {
let mainWindow = new BrowserWindow({ width: 800, height: 600 });
mainWindow.loadUrl(`file://${__dirname}/index.pug`);
// the rest...
});
Even more!
If you want to have least effort when developing electron packages, take a look at neutron!