I'm trying to use nanoc 3.5.0 with the pandoc
filter that uses pandoc-ruby
. Specifically, I'm not able to pass several options from my Rules
file such that the final call to PandocRuby.convert()
looks like this:
PandocRuby.convert(content,
{:from => :markdown, :to => :html}, :no_wrap,
:table_of_contents, :mathjax, :standalone,
{"template" => Dir.getwd + '/layouts/pandocTemplate.html'})
When I place the above call in a custom filter, everything works fine. However, I would like to specify pandoc options in Rules
such that I don't have to create a special filter for every set of options.
The default pandoc filter is defined as the function run(content, params={})
and simply calls PandocRuby.convert(content, params)
. How can I set params
such that PandocRuby.convert()
gets called correctly? The following directives in Rules
do not work:
filter :pandoc, :params => { :from => :markdown, :to => :html, :no_wrap, :table_of_contents, :mathjax, :standalone, "template" => Dir.getwd + '/layouts/pandocTemplate.html' }
filter :pandoc, :params => { :from => :markdown, :to => :html, :no_wrap => true, :table_of_contents => true, :mathjax => true, :standalone => true, "template" => Dir.getwd + '/layouts/pandocTemplate.html' }
The first directive results in a Ruby error, the second directive runs but gives me a blank page, indicating that pandoc did not get called right. I'm not really familiar with Ruby, so my current efforts are just stabs in the dark.