alphabetum/pandoc-ruby — pull request #1 by dsanson (2012-03-03 04:59:57+00:00)
Title: updates for pandoc 1.9

I've added all the readers and writers supported by pandoc 1.9, except the `+lhs` readers and writers, which, for reasons I did not understand, would not work at all for me. These changes shouldn't effect people with older versions of pandoc installed.

The new writers include odt, docx, and epub writers. These cannot generate stdout, but they work fine, so long as one specifies an output file, i.e.,

PandocRuby.new('# Markdown Title', :from => :markdown, :to => :docx, :output => "test.docx")

Or, since pandoc is smart about extensions,

PandocRuby.new('# Markdown Title', :from => :markdown, :output => "test.docx")

One issue is that, for these formats, `:to_s` probably shouldn't be synonymous with `:convert`.

Pandoc 1.9 handles pdfs a bit differently. Something like `pandoc test.markdown -o test.pdf` generates a pdf file, but there is no pdf writer, so `pandoc -t pdf test.markdown -o test.pdf` doesn't work. So

PandocRuby.new('# Markdown Title', :from => :markdown, :output => "test.pdf")

works fine. Also, for this same reason, `to_pdf` is not supported.

I did not add tests for the new output formats. The existing tests are outdated. Perhaps you have an automated way of generating the snippets for the tests, using pandoc? Also I'm not sure what appropriate tests would be for pdf, odt, docx, and epub output.