Sha256: 8288866f207c92c6b9f659024f61c146acde0e3eaff3f4c25cb8952317265a08

Contents?: true

Size: 970 Bytes

Versions: 8

Compression:

Stored size: 970 Bytes

Contents

# frozen_string_literal: true

module Epuber
  class Compiler
    module FileTypes
      require_relative 'generated_file'

      class NavFile < GeneratedFile
        # @return [Epuber::Version]
        #
        attr_reader :epub_version

        # @param [Epuber::Version] epub_version
        #
        def initialize(epub_version)
          super()

          @epub_version = epub_version

          properties << :navigation

          self.destination_path = if epub_version >= 3
                                    'nav.xhtml'
                                  else
                                    'nav.ncx'
                                  end

          self.path_type = :manifest
        end

        # @param [Compiler::CompilationContext] compilation_context
        #
        def process(compilation_context)
          gen = NavGenerator.new(compilation_context)
          write_generate(gen.generate_nav.to_s)
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
epuber-0.10.3 lib/epuber/compiler/file_types/nav_file.rb
epuber-0.10.2 lib/epuber/compiler/file_types/nav_file.rb
epuber-0.10.1 lib/epuber/compiler/file_types/nav_file.rb
epuber-0.9.3 lib/epuber/compiler/file_types/nav_file.rb
epuber-0.9.2 lib/epuber/compiler/file_types/nav_file.rb
epuber-0.9.1 lib/epuber/compiler/file_types/nav_file.rb
epuber-0.9.0 lib/epuber/compiler/file_types/nav_file.rb
epuber-0.8.0 lib/epuber/compiler/file_types/nav_file.rb