https://github.com/oncomouse/gulp-pandoc-writer
https://github.com/oncomouse/gulp-pandoc-writer
Last synced: 12 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/oncomouse/gulp-pandoc-writer
- Owner: oncomouse
- Created: 2016-04-29T15:02:01.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2017-11-13T16:15:10.000Z (over 8 years ago)
- Last Synced: 2024-11-07T05:40:42.248Z (over 1 year ago)
- Language: JavaScript
- Size: 6.84 KB
- Stars: 4
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
# gulp-pandoc-writer
`gulp` plugin that generates static files using `pandoc`.
Ported directly from [gulp-pandoc-pdf](https://github.com/brightsparklabs/gulp-pandoc-pdf), just changed to work with more file formats (gulp-pandoc-pdf only produces PDF files).
## Installation
```shell
npm install gulp-pandoc-writer --save-dev
```
## Usage
```javascript
var pandocWriter = require('gulp-pandoc-writer');
gulp.task('build', function() {
gulp.src('src/markdown/**/*.md')
.pipe(pandocWriter({
outputDir: 'dist/docx',
inputFileType:'.md',
outputFileType: '.docx',
args: [
'--smart'
]
}))
.pipe(gulp.dest('build/html'));
});
```
## API
### pandocWriter(options)
#### options.outputDir
**Type:** String
The directory to which output will be written by the plugin. The plugin will also generate HTML files for streaming purposes.
#### options.inputFileType
This can be any filetype supported by pandoc. Defaults to .md when no filetype is specified.
#### options.outputFileType
**Type:** String
Can be any file type, but the major focus of this plugin are files such as `.docx`, `.odt`, `.epub` that `pandoc` can create but will not write to `STDOUT` for streaming purposes in Gulp.
#### options.args
**Type:** Array
Additional arguments that might need to be passed to pandoc, e.g. `['--smart']`.