forked from tompollard/phd_thesis_markdown
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request tompollard#4 from ArcoMul/add-grunt
Grunt task file to watch markdown files and auto-compile them
- Loading branch information
Showing
4 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,3 +55,6 @@ target/ | |
|
||
# ignore DS store files | ||
.DS_Store | ||
|
||
# Node modules | ||
node_modules/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
module.exports = function(grunt) { | ||
|
||
var type = grunt.option('type'); | ||
if(!type) type = 'pdf:html'; | ||
|
||
// Project configuration. | ||
grunt.initConfig({ | ||
pkg: grunt.file.readJSON('package.json'), | ||
notify: { | ||
make: { | ||
options: { | ||
message: "Compilation done" | ||
} | ||
} | ||
}, | ||
watch: { | ||
options: { | ||
interrupt: true | ||
}, | ||
scripts: { | ||
files: ['source/*.md'], | ||
tasks: ['make:' + type, 'notify:make'] | ||
} | ||
}, | ||
notify_hooks: { | ||
options: { | ||
enabled: true, | ||
max_jshint_notifications: 5, // maximum number of notifications from jshint output | ||
title: "Thesis compilation", // defaults to the name in package.json, or will use project directory's name | ||
success: true, // whether successful grunt executions should be notified automatically | ||
duration: 2 // the duration of notification in seconds, for `notify-send only | ||
} | ||
} | ||
}); | ||
|
||
grunt.loadNpmTasks('grunt-contrib-watch'); | ||
grunt.loadNpmTasks('grunt-make'); | ||
grunt.loadNpmTasks('grunt-notify'); | ||
|
||
grunt.registerTask('default', ['make:' + type]); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"name": "MarkdownThesis", | ||
"version": "1.0.0", | ||
"scripts": { | ||
"watch": "grunt watch" | ||
}, | ||
"dependencies": { | ||
"grunt-cli": "^0.1.13", | ||
"grunt": "^0.4.5", | ||
"grunt-contrib-watch": "^0.6.1", | ||
"grunt-make": "^1.0.0", | ||
"grunt-notify": "^0.4.1" | ||
} | ||
} |