Requires haskell-stack
Add this line to your application's Gemfile:
gem 'pandoc_rb'
And then execute:
$ bundle install
Or install it yourself as:
$ gem install pandoc_rb
pandoc_rb
's main interface is contained in the PandocRb
module.
The public interface consists of constants and a main conversion function
The constants include:
PandocRb::Version # The current version
PandocRb::Readers # A list of allowed readers
PandocRb::Writers # A list of allowed writers
And the main conversion function is:
# General conversion function
PandocRb.convert input_format, output_format, input_string, (optional) extract_media_path
# Convert `markdown` to `latex`
PandocRb.convert 'markdown', 'latex', '_italic text_'
# Convert `docx` to `latex` from file
PandocRb.convert 'docx', 'latex', File.binread('some_doc.docx'), `extract/figures/dir`
# Convert `markdown` to `docx`, writing to a `docx` file
File.open 'some_doc.docx', 'wb' do |file|
file.write PandocRb.convert('markdown', 'docx', '_italic text_')
end
- Fork it ( https://github.com/michaeljklein/pandoc_rb/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request