Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yan-foto/electron-pug
Simple electron module to render Pug (former Jade) templates
https://github.com/yan-foto/electron-pug
Last synced: 2 months ago
JSON representation
Simple electron module to render Pug (former Jade) templates
- Host: GitHub
- URL: https://github.com/yan-foto/electron-pug
- Owner: yan-foto
- License: mit
- Created: 2016-04-16T06:37:56.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2020-12-20T13:23:36.000Z (about 4 years ago)
- Last Synced: 2024-10-12T18:08:01.245Z (3 months ago)
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/electron-pug
- Size: 22.5 KB
- Stars: 35
- Watchers: 2
- Forks: 10
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# electron pug
This module is a simple `file` protocol interceptor for [electron](https://github.com/atom/electron) which compiles all (local) URLs to files with `.pug` extension (e.g `/home/electron-pug/index.pug`) on the fly.
![license](https://img.shields.io/npm/l/electron-pug.svg)
# Installation```
npm install electron-pug
```# Usage
Just initialize this module with desired options for [Pug](https://www.npmjs.com/package/pug) package and your locals:```js
'use strict';const {app, BrowserWindow} = require('electron')
const locals = {/* ...*/}
const setupPug = require('electron-pug')// Standard stuff
app.on('ready', async () => {
try {
let pug = await setupPug({pretty: true}, locals)
} catch (err) {
// Could not initiate 'electron-pug'
}let mainWindow = new BrowserWindow({ width: 800, height: 600 })
mainWindow.loadURL(`file://${__dirname}/index.pug`)
// the rest...
})
```# Endorsements
Here is a list of all projects (known to me) who have silently endorsed this project (or its [predecessor](https://github.com/yan-foto/electron-jade)) by copying the source code without attribution: `yet-another-electron-pug`, `electron-nunjucks`, `wfo-app`, `demetra-aplikacija`, `electron-twig`, `FreeFrontiers-App`, `electron-posthtml`, and many other that I failed to track down!# Even more!
If you want to have least effort when developing electron packages, take a look at [neutron](https://github.com/yan-foto/neutron)!