Sha256: 28626d9449d776e6b08df0c980f1b8254a71ab6c8404621d9fe68cfd980c1be7

Contents?: true

Size: 449 Bytes

Versions: 11

Compression:

Stored size: 449 Bytes

Contents

require 'epubber/generators/generator'

module Epubber::Generators
  class Introduction < Generator
    def generate
      # Because this is an optional generator, don't do anything if there's no
      # introduction in the book
      return if book.introduction.nil?

      content = template.parse file: 'OEBPS/Text/introduction.xhtml', context: book_context
      persist file: 'OEBPS/Text/introduction.xhtml', content: content
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
epubber-0.2.0 lib/epubber/generators/introduction.rb
epubber-0.1.5 lib/epubber/generators/introduction.rb
epubber-0.1.4 lib/epubber/generators/introduction.rb
epubber-0.1.3 lib/epubber/generators/introduction.rb
epubber-0.1.2 lib/epubber/generators/introduction.rb
epubber-0.1.1 lib/epubber/generators/introduction.rb
epubber-0.1.0 lib/epubber/generators/introduction.rb
epubber-0.0.4 lib/epubber/generators/introduction.rb
epubber-0.0.3 lib/epubber/generators/introduction.rb
epubber-0.0.2 lib/epubber/generators/introduction.rb
epubber-0.0.1 lib/epubber/generators/introduction.rb