Permalink
Browse files

Implement settings for compiling and running by gulp

  • Loading branch information...
yhatt committed Feb 5, 2016
1 parent e39d48d commit 8688eaadc359ffb28e61baaeeb02ddd5849d5f9d
Showing with 59 additions and 17 deletions.
  1. +4 −0 .gitignore
  2. +8 −0 README.md
  3. +19 −0 coffee/main.coffee
  4. +26 −0 gulpfile.coffee
  5. +1 −17 main.js
  6. +1 −0 package.json
View
@@ -34,3 +34,7 @@ node_modules
# Editor
*.sublime-*
# Build with gulp
js/
css/
View
@@ -8,6 +8,14 @@ Presentation writer with markdown (Powered by Electron)
npm install
```
And run below gulp task:
```
gulp run
```
### Run Electron directly
Run `electron.bat` or `./node_modules/.bin/electron.cmd .` from console for executing mdSlide on Windows.
On Mac or Linux, run `./node_modules/.bin/electron .` from console. When direnv has installed, you can execute with `electron .` (If direnv blocked, please run `direnv allow`).
View
@@ -0,0 +1,19 @@
app = require 'app'
BrowserWindow = require 'browser-window'
require('crash-reporter').start()
main_window = null
app.on 'window-all-closed', () ->
app.quit() if process.platform != 'darwin'
app.on 'ready', () ->
main_window = new BrowserWindow
width: 800
height: 300
main_window.loadUrl "file://#{__dirname}/../index.html"
main_window.on 'closed', () ->
main_window = null
View
@@ -0,0 +1,26 @@
gulp = require('gulp')
$ = do require('gulp-load-plugins')
gulp.task 'compile', ['compile:coffee', 'compile:sass']
gulp.task 'compile:coffee', () ->
gulp.src 'coffee/**/*.coffee'
.pipe $.plumber()
.pipe $.sourcemaps.init()
.pipe $.coffee
bare: true
.pipe $.uglify()
.pipe $.sourcemaps.write()
.pipe gulp.dest('js')
gulp.task 'compile:sass', () ->
gulp.src ['sass/**/*.scss', 'sass/**/*.sass']
.pipe $.plumber()
.pipe $.sourcemaps.init()
.pipe $.sass()
.pipe $.sourcemaps.write()
.pipe gulp.dest('css')
gulp.task 'run', ['compile'], () ->
gulp.src '.'
.pipe $.runElectron()
View
18 main.js
@@ -1,19 +1,3 @@
'use strict';
var app = require('app');
var BrowserWindow = require('browser-window');
require('crash-reporter').start();
var main_window = null;
app.on('window-all-closed', function(){
if (process.platform != 'darwin') app.quit();
});
app.on('ready', function(){
main_window = new BrowserWindow({ width: 800, height: 300 });
main_window.loadUrl('file://' + __dirname + '/index.html');
main_window.on('closed', function() { main_window = null; });
});
require('./js/main');
View
@@ -16,6 +16,7 @@
"gulp-coffee": "^2.3.1",
"gulp-load-plugins": "^1.2.0",
"gulp-plumber": "^1.0.1",
"gulp-run-electron": "^1.2.2",
"gulp-sass": "^2.2.0",
"gulp-sourcemaps": "^1.6.0",
"gulp-uglify": "^1.5.1"

0 comments on commit 8688eaa

Please sign in to comment.