xwmx / pandoc-ruby

Ruby wrapper for Pandoc
MIT License
340 stars 43 forks source link

How to pass Stack Size Parameter in convert()? #24

Closed DeaconF closed 4 years ago

DeaconF commented 7 years ago

How can i pass stack size parameter (+RTS -K64m -RTS) in PandocRuby.convert()

on command line it should be: pandoc +RTS -K64m -RTS file.html -f html -t mediawiki

archonic commented 5 years ago

I was wondering the same thing and went looking for the answer. It looks as if we can't set a flag with "+".

https://github.com/alphabetum/pandoc-ruby/blob/master/lib/pandoc-ruby.rb#L259

I would enjoy a way to set the command and its options in a less abstracted way. For now, it looks like we can get around the issue by setting options in the pandoc_path.

Before calling convert:

PandocRuby.pandoc_path = "pandoc +RTS -K64m -RTS"
xwmx commented 4 years ago

As of version 2.1.3, command line options specified as strings are passed to pandoc unaltered. So now the following should work:

PandocRuby.convert(@string, '+RTS', '-K64m', '-RTS', output: 'file.html', from: 'html', to: 'mediawiki')

Thanks!