eshinn / node-pandoc Goto Github PK
View Code? Open in Web Editor NEWRun Pandoc from NodeJS. Pandoc installation is required.
License: MIT License
Run Pandoc from NodeJS. Pandoc installation is required.
License: MIT License
args
"-o c:\Users\Shaun Stone\Desktop\automating-with-nodejs\build\docx\automating-with-nodejs.docx --extract-media 'c:\Users\Shaun Stone\Desktop\automating-with-nodejs\chapters\images'"
//node-pandoc/index.js
if (args.constructor === String) {
args = args.split(' ');
}
__proto__:Array(0) [, …]
0:"-o"
1:"c:\Users\Shaun"
2:"Stone\Desktop\automating-with-nodejs\build\docx\automating-with-nodejs.docx"
3:"--extract-media"
4:"'c:\Users\Shaun"
5:"Stone\Desktop\automating-with-nodejs\chapters\images'"
Hi, thank you for building this great module! It runs just fine through electron
, but after I package the app with electron-builder
or electron-packager
, trying to use Pandoc in the app gives me the following error:
Uncaught Exception:
Error: spawn pandoc ENOENT
I'm an Electron and Node novice, but from what I've read it appears that this means the app can't find Pandoc. Some command line tests:
> which pandoc
/usr/local/bin/pandoc
> pandoc -v
pandoc 2.5
Compiled with pandoc-types 1.17.5.4, texmath 0.11.1.2, skylighting 0.7.4
> echo $PATH
/usr/local/sbin:/usr/local/bin: ...
I need to use the option --epub-cover-image, so when I use it on the CLI it works good, with the following combinations
--epub-cover-image
--epub-cover-image=
--epub-cover-image ''
--epub-cover-image=''
But passing the same path to nodePandoc like this
nodePandoc(content,
-f html -t epub -o ${outputPath} --epub-cover-image=/Users/myUser/Library/Application Support/Electron/images/e603202a-8d25-4ac8-84ef-04ff001feea1.png, (err, result) => {
I always get an error: openFile does not exists (No such file or director).
hi, thanks for the module.
Situation
Error thrown:
Oh No: Error: pandoc: .: openBinaryFile: permission denied (Permission denied)
Expected behavior
Should create a folder called "media" in current directory and extract the images there
Works fine in command line with pandoc.
Solution with problems
It works with args as string... but using string causes problems with spaces and slashes in -o
So this solution doesn't work with batch files having spaces in output.
Environment
Windows 11
pandoc 2.18
node-pandoc 0.3.0
node 16.13.1
Hope you can give me a hint.
But i want to be able assign the return result to a variable then send that to the front end. But the variable comes up as undefined. Any help?
var nodePandoc = require('node-pandoc');
var src, args;
var file = '';
src = 'Lesson.docx';
args = '-f docx -t markdown -o ./Lesson.md';
callback = function (err, result) {
if (err) return console.error('Oh No: ',err);
console.log("callback result:",result);
file = result
};
nodePandoc(src, args, callback);
console.log(file);
Hi,
I'm currently running pandoc manually through command line to create a pdf from a multitude of .md files. To automate the process, I was hoping I could use this tool. Unfortunately, it appears that only single files are allowed??? This is odd because pandoc handles it seamlessly.
If I am missing something and there is a way to pass in many markdown files as source please let me know.
Thanks!
Hello thank you for this plugin!
I want to add content in a loop to output pandoc file.
With following args '-f markdown -t html >> ./test.html';
I get Error: pandoc: >>: openBinaryFile: does not exist (No such file or directory)
.
I think >>
is not supported.
Thanks for your help,
Matthias
I get some uncaught errors like:
Uncaught Error: write EPIPE
Uncaught Error: spawn pandoc ENOENT
But it is impossible to catch inside the nodePandoc callback (or outside). I want to give a user some alert that pandoc is not installed.
Thanks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.