Sha256: 2f74237ebd37b0ed25bcc6d6e855927610e12401c2bf4de8bf7af43122d72a99
Contents?: true
Size: 545 Bytes
Versions: 11
Compression:
Stored size: 545 Bytes
Contents
require 'epubber/generators/generator' module Epubber::Generators class Chapters < Generator def generate compiled_template = template.compile 'OEBPS/Text/chapter.xhtml' book.chapters.each do |chapter| generate_chapter compiled_template, chapter end end protected def generate_chapter(compiled_template, chapter) context = chapter.contextify content = compiled_template.render context persist file: "OEBPS/Text/chapter#{context['id']}.xhtml", content: content end end end
Version data entries
11 entries across 11 versions & 1 rubygems