Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Impossible to pass generic Pandoc options in Rules #526

Closed
denisdefreyne opened this issue Jan 31, 2015 · 4 comments
Closed

Impossible to pass generic Pandoc options in Rules #526

denisdefreyne opened this issue Jan 31, 2015 · 4 comments
Milestone

Comments

@denisdefreyne
Copy link
Member

It is impossible to pass these options to Pandoc in the Rules file:

:s, {:f => :markdown, :to => :html}, 'no-wrap', :toc
@ghiknt
Copy link

ghiknt commented Jan 31, 2015

After further experiment it is also impossible to pass options twice (e.g. --filter). Since the last one is all that is kept in the hash. Temporally worked around by adapting test case to filter wrapper:

class PandocCommandLine < Nanoc::Filter
  identifier :pandoc_commandline
  type :text
  def run(content, params={})
   filter = ::Nanoc::Filters::Pandoc.new
   filter.setup_and_run(content, *params[:args])
  end
end

Which is called by Rules file.

opts = ['table-of-contents', {:to => :html5, 'base-header-level' => 2}, {:filter =>'pandoc-zotxt'}, {:filter => 'pandoc-citeproc'}]
filter :pandoc_commandline, :args => opts 
  • Note table-of-contents is not a good one to use for testing though since it only gets rendered in latest pandoc when --standalone is specified.

@denisdefreyne
Copy link
Member Author

Yeah, I feel that the only solution to this would be to introduce an arbitrary :args param, as you suggested. I think I’ll fix it like that; there’ll be a PR incoming soon.

@denisdefreyne
Copy link
Member Author

Potential fix in #535.

@denisdefreyne
Copy link
Member Author

Fixed by #535.

@denisdefreyne denisdefreyne added this to the 3.7.6 milestone Apr 19, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants