Skip to content
This repository has been archived by the owner on Jul 24, 2023. It is now read-only.

brightsparklabs/gulp-pandoc-pdf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gulp-pandoc-pdf

gulp plugin for generating PDFs via pandoc.

Based off the excellent gulp-pandoc plugin.

Generating PDFs with pandoc requires the use of the --output flag to write the file to disk, rather than just the -t flag allowing the data to be streamed through gulp pipes.

This plugin simplifies generating the PDFs in the output directory you desire whilst also piping the data through the gulp pipeline in HTML format.

Installation

# shell 
npm install gulp-pandoc-pdf --save-dev 

Usage

Within gulpfile.js:

// javascript

var pdf = require('gulp-pandoc-pdf');

gulp.task('build', function() {
    gulp.src('src/markdown/**/*.md')
        .pipe(pdf({
            pdfDir: 'build/pdf'
        })) 
        .pipe(gulp.dest('build/html'));
});

API

pdf(options)

options.pdfDir

Type: string

Path to the directory into which the generated PDF files will be placed. This is relative to gulpfile.js. E.g. build/pdf.

This parameter is mandatory.

options.args

Type: array

Additional command line parameters to pandoc. E.g. ['--smart', '--css=style.css'].

Licenses

Refer to the LICENSE file for details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published