PHP Classes

File: gulpfile.js

Recommend this page to a friend!
  Classes of Barton Phillips  >  MySQL Slideshow  >  gulpfile.js  >  Download  
File: gulpfile.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: MySQL Slideshow
Present slideshow from images listed in a database
Author: By
Last change:
Date: 7 years ago
Size: 844 bytes
 

Contents

Class file image Download
// Gulpfile
// Take the README.md and make a README.html
//

var gulp = require('gulp'),
exec = require('gulp-exec'),
header = require('gulp-header'),
footer = require('gulp-footer'),
rename = require('gulp-rename');

var readmeHeader = "<!DOCTYPE html>\n<html>\n<head>\n<style>\npre {\n"+
                   "background-color: #DBDBDB;\n"+
                   "overflow: auto;\n}\n</style>\n</head>\n<body>\n";

gulp.task('default', function() {
  return gulp.src("README.md")
      .pipe(exec('pandoc -f markdown_github <%= file.path %> -t html',
                 {pipeStdout: true}))
      .pipe(header(readmeHeader))
      .pipe(footer("\n</body>\n</html>\n"))
      .pipe(rename('README.html'))
      .pipe(gulp.dest('./'))
});

// Watch for changes to README.md

gulp.task('watch', function() {
  gulp.watch('README.md', ['default']);
});
For more information send a message to info at phpclasses dot org.