gulp-markdown-pdf
Advanced tools
+15
-15
| 'use strict'; | ||
| var gutil = require('gulp-util'); | ||
| var through = require('through2'); | ||
| var markdownpdf = require('markdown-pdf'); | ||
| const gutil = require('gulp-util'); | ||
| const through = require('through2'); | ||
| const markdownpdf = require('markdown-pdf'); | ||
| module.exports = function (options) { | ||
| return through.obj(function (file, enc, cb) { | ||
| module.exports = options => { | ||
| return through.obj((file, enc, cb) => { | ||
| if (file.isNull()) { | ||
@@ -19,14 +19,14 @@ cb(null, file); | ||
| markdownpdf(options) | ||
| .from.string(file.contents.toString()) | ||
| .to.buffer(function (err, buffer) { | ||
| if (err) { | ||
| cb(new gutil.PluginError('gulp-markdown-pdf', err, {fileName: file.path})); | ||
| return; | ||
| } | ||
| .from.string(file.contents.toString()) | ||
| .to.buffer((err, buffer) => { | ||
| if (err) { | ||
| cb(new gutil.PluginError('gulp-markdown-pdf', err, {fileName: file.path})); | ||
| return; | ||
| } | ||
| file.contents = buffer; | ||
| file.path = gutil.replaceExtension(file.path, '.pdf'); | ||
| cb(null, file); | ||
| }); | ||
| file.contents = buffer; | ||
| file.path = gutil.replaceExtension(file.path, '.pdf'); | ||
| cb(null, file); | ||
| }); | ||
| }); | ||
| }; |
+41
-39
| { | ||
| "name": "gulp-markdown-pdf", | ||
| "version": "4.0.0", | ||
| "description": "Markdown to PDF", | ||
| "license": "MIT", | ||
| "repository": "sindresorhus/gulp-markdown-pdf", | ||
| "author": { | ||
| "name": "Sindre Sorhus", | ||
| "email": "sindresorhus@gmail.com", | ||
| "url": "sindresorhus.com" | ||
| }, | ||
| "engines": { | ||
| "node": ">=0.10.0" | ||
| }, | ||
| "scripts": { | ||
| "test": "mocha" | ||
| }, | ||
| "files": [ | ||
| "index.js" | ||
| ], | ||
| "keywords": [ | ||
| "gulpplugin", | ||
| "markdown", | ||
| "marked", | ||
| "md", | ||
| "compile", | ||
| "convert", | ||
| "markup", | ||
| "pdf", | ||
| "template", | ||
| "phantomjs" | ||
| ], | ||
| "dependencies": { | ||
| "gulp-util": "^3.0.0", | ||
| "markdown-pdf": "^7.0.0", | ||
| "through2": "^2.0.0" | ||
| }, | ||
| "devDependencies": { | ||
| "mocha": "*" | ||
| } | ||
| "name": "gulp-markdown-pdf", | ||
| "version": "5.0.0", | ||
| "description": "Markdown to PDF", | ||
| "license": "MIT", | ||
| "repository": "sindresorhus/gulp-markdown-pdf", | ||
| "author": { | ||
| "name": "Sindre Sorhus", | ||
| "email": "sindresorhus@gmail.com", | ||
| "url": "sindresorhus.com" | ||
| }, | ||
| "engines": { | ||
| "node": ">=4" | ||
| }, | ||
| "scripts": { | ||
| "test": "xo && ava" | ||
| }, | ||
| "files": [ | ||
| "index.js" | ||
| ], | ||
| "keywords": [ | ||
| "gulpplugin", | ||
| "markdown", | ||
| "marked", | ||
| "md", | ||
| "compile", | ||
| "convert", | ||
| "markup", | ||
| "pdf", | ||
| "template", | ||
| "phantomjs" | ||
| ], | ||
| "dependencies": { | ||
| "gulp-util": "^3.0.0", | ||
| "markdown-pdf": "^8.0.0", | ||
| "through2": "^2.0.0" | ||
| }, | ||
| "devDependencies": { | ||
| "ava": "*", | ||
| "p-event": "^1.3.0", | ||
| "xo": "*" | ||
| } | ||
| } |
+8
-8
@@ -18,10 +18,10 @@ # gulp-markdown-pdf [](https://travis-ci.org/sindresorhus/gulp-markdown-pdf) | ||
| ```js | ||
| var gulp = require('gulp'); | ||
| var markdownpdf = require('gulp-markdown-pdf'); | ||
| const gulp = require('gulp'); | ||
| const markdownPdf = require('gulp-markdown-pdf'); | ||
| gulp.task('default', function () { | ||
| return gulp.src('intro.md') | ||
| gulp.task('default', () => | ||
| gulp.src('intro.md') | ||
| .pipe(markdownpdf()) | ||
| .pipe(gulp.dest('dist')); | ||
| }); | ||
| .pipe(gulp.dest('dist')) | ||
| ); | ||
| ``` | ||
@@ -32,3 +32,3 @@ | ||
| ### markdownpdf([options]) | ||
| ### markdownPdf([options]) | ||
@@ -40,2 +40,2 @@ See the `markdown-pdf` [options](https://github.com/alanshaw/markdown-pdf#options). | ||
| MIT © [Sindre Sorhus](http://sindresorhus.com) | ||
| MIT © [Sindre Sorhus](https://sindresorhus.com) |
Sorry, the diff of this file is not supported yet
3344
-1.53%3
200%+ Added
+ Added
- Removed
- Removed
Updated