pandocjs
v2.9.2-1.1
Published
Another wrapper for pandoc, including automatic binary download
Downloads
23
Maintainers
Readme
pandocjs
Another wrapper for pandoc, including automatic binary download.
Installation
npm i pandocjs
Why?
Because I couldn't any npm package to wrap pandoc for use
with JavaScript in node without requiring pandoc to be already installed
locally. This package installs the required binaries in the background,
independent in means of version and binaries from a locally pandoc
installation.
Usage
To convert the contents of an existing file (docbook format) info to a file in
markdown format, use the ConvertFileSync()
method:
const pandoc = require('pandocjs');
pandoc.ConvertFileSync('document.xml', 'docbook', 'document.md', 'gfm', { atxHeaders: true, wrap: 'preserve' });
Development Support
There's plenty of JsDoc documentation included in this package (auto generated
calling pandoc
with the --help
, --list-input-formats
and
--list-output-formats
options). If your development environment provides
assistance by reading this information, all methods can be used pretty
straight forward (e.g. Visual Studio Code reads the JsDoc comments to
include it in the Intellisense feature).