Skip to content

Instantly share code, notes, and snippets.

@esperia
Created January 3, 2017 07:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save esperia/b11a9ee01725832194f45dee2546745b to your computer and use it in GitHub Desktop.
Save esperia/b11a9ee01725832194f45dee2546745b to your computer and use it in GitHub Desktop.
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"
}
}
@esperia
Copy link
Author

esperia commented Jan 3, 2017

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