Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Auto-generate pdf for Lilypond.
var gulp = require('gulp');
var path = require('path');
var shell = require('gulp-shell')
gulp.task('default', ['watch']);
gulp.task('watch', function(){
gulp.watch('./**/*.ly', ['build']);
});
gulp.task('build', function () {
return gulp.src('*.ly', {read: false})
.pipe(shell([
'docker run -i --rm -v $(pwd):/work -w /work mikechernev/lilypond lilypond <%= f(file.path) %>',
], {
templateData: {
f: function (s) {
return path.basename(s);
//return s.replace(/$/, '.bak')
},
}
}))
})
{
"name": "lilypond",
"version": "0.1.0",
"description": "Auto-generate pdf for lilypond using the mikechernev/lilypond of DockerImage",
"scripts": {
"start": "gulp"
},
"author": "neske",
"license": "MIT",
"devDependencies": {
"gulp": "^3.9.1",
"gulp-shell": "^0.5.2"
}
}
Owner

esperia commented Jan 3, 2017 edited

Prerequisites

Usage

# Provide docker image
docker pull mikechernev/lilypond

# Clone this files
git clone https://gist.github.com/b11a9ee01725832194f45dee2546745b.git lilypond-builder
cd lilypond-builder

# install dependencies
npm install

# New files
touch my_beautiful_score.ly

# Start watch
npm start

# Edit files
vim my_beautiful_score.ly
# If you saved, start building automatically.
# If you created new file after `npm start` job, require restart this.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment