xwmx / pandoc-ruby

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

DOCX to HTML #33

Closed AaronDasani closed 4 years ago

AaronDasani commented 5 years ago

Is there any way to convert a docx file to a html or textile format. I know PANDOC can do it because i done it in Javascript.

However it is being a pain in Ruby. I do have pandoc-ruby in my gem file. I saw in the pandoc-ruby documentation that you cannot convert docx to anything.

If pandoc-ruby is a wrapper for PANDOC, isn't there a way to convert docx to html. Because, again PANDOC can do it, but the wrapper, pandoc-ruby can't.

Any help would be nice and appreciated.

xwmx commented 4 years ago

As of the latest version, 2.1.0, docx files can be converted by specifying the file path as an array:

PandocRuby.new(['/path/to/example.docx'], from: 'docx', to: 'html').convert

Thanks for the heads up!