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
ddfreyne opened this issue Jan 31, 2015 · 4 comments
Closed

Impossible to pass generic Pandoc options in Rules #526

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

Comments

@ddfreyne
Copy link
Member

@ddfreyne ddfreyne commented Jan 31, 2015

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 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.

@ddfreyne
Copy link
Member Author

@ddfreyne ddfreyne commented Feb 7, 2015

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.

@ddfreyne
Copy link
Member Author

@ddfreyne ddfreyne commented Feb 21, 2015

Potential fix in #535.

@ddfreyne
Copy link
Member Author

@ddfreyne ddfreyne commented Mar 7, 2015

Fixed by #535.

@ddfreyne ddfreyne closed this Mar 7, 2015
@ddfreyne ddfreyne 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
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants