asciidoctor-pdf icon indicating copy to clipboard operation
asciidoctor-pdf copied to clipboard

Allow optimizer to be pluggable

Open mojavelinux opened this issue 4 years ago • 0 comments

Currently, it's only possible to override the optimizer by implementing (or patching) the built-in Asciidoctor::PDF::Optimizer class (see README). Instead, it should be possible to pass a custom class or object to the API using the :pdf_optimizer option.

The interface for the Optimizer is:

class Optimizer
  def initialize quality, compliance_level; end
  def optimize_file path; end
end

An alternative would be to allow the class to self register, similar to how the syntax highlighter adapters or converter work in core.

mojavelinux avatar Oct 07 '20 05:10 mojavelinux