Class: Giblish::PdfMathPostbuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/giblish/configurator.rb

Overview

A combined docattr_provider and post-processor that:

  • instructs asciidoctor-mathematical to use svg as format

  • removes svg cache files produced by asciidoctor-mathematical

Instance Method Summary collapse

Instance Method Details

#document_attributes(src_node, dst_node, dst_top) ⇒ Object



62
63
64
65
66
# File 'lib/giblish/configurator.rb', line 62

def document_attributes(src_node, dst_node, dst_top)
  {
    "mathematical-format" => "svg"
  }
end

#on_postbuild(src_topdir, dst_tree, converter) ⇒ Object

called by the TreeConverter during the post_build phase



52
53
54
55
56
57
58
59
60
# File 'lib/giblish/configurator.rb', line 52

def on_postbuild(src_topdir, dst_tree, converter)
  dst_top = src_topdir.pathname
  dst_top.each_child do |c|
    if c.basename.to_s.match?(/^stem-[0-9a-f]*\.svg$/)
      Giblog.logger.debug("will remove #{c}")
      c.delete
    end
  end
end