GithubHelp home page GithubHelp logo

node-pandoc's People

Contributors

eshinn avatar yashsriv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

node-pandoc's Issues

Windows Paths with spaces break

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'"

Packaged app can't find Pandoc

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: ...

problem with space on filename path in argument

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).

Extracting media throws Permission Denied

hi, thanks for the module.

Situation

  • Using a docx with images.
  • Using "--extract-media=", "." in the args array to extract the images in the docx document

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.

How to assign the return value to a variable

see stack overflow question

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);

Cannot pass in an array of src files

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!

openBinaryFile: does not exist (No such file or directory)

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

How to detect if pandoc is installed

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.