Class: Softcover::Builders::Preview

Inherits:
Softcover::Builder show all
Defined in:
lib/softcover/builders/preview.rb

Constant Summary

Constants included from Utils

Utils::UNITS

Instance Attribute Summary

Attributes inherited from Softcover::Builder

#built_files, #manifest

Instance Method Summary collapse

Methods inherited from Softcover::Builder

#clean!, #initialize

Methods included from Utils

#add_highlight_class!, #article?, #as_size, #book_file_lines, #chapter_label, #commands, #current_book, #dependency_filename, #digest, #executable, #execute, #filename_or_default, #first_path, #get_filename, #html_extension, #in_book_directory?, #language_labels, #linux?, #logged_in?, #master_content, #master_filename, #master_latex_header, #mkdir, #non_comment_lines, #os_x?, #path, #polytexnic_html, #raw_lines, #reset_current_book!, #rm, #rm_r, #silence, #silence_stream, #source, #template_dir, #tmpify, #unpublish_slug, #write_master_latex_file, #write_pygments_file

Constructor Details

This class inherits a constructor from Softcover::Builder

Instance Method Details

#build!Object



5
6
7
8
9
10
11
12
13
14
# File 'lib/softcover/builders/preview.rb', line 5

def build!
  if article?
    $stderr.puts "Previews not supported for articles"
    exit(1)
  end
  # Recall that MOBI generation makes an EPUB as a side-effect.
  Softcover::Builders::Mobi.new.build!(preview: true)
  Softcover::Builders::Pdf.new.build!(preview: true)
  extract_pdf_pages
end