Module: Softcover

Extended by:
Softcover
Includes:
Utils
Included in:
Softcover
Defined in:
lib/softcover.rb,
lib/softcover/cli.rb,
lib/softcover/client.rb,
lib/softcover/config.rb,
lib/softcover/builder.rb,
lib/softcover/formats.rb,
lib/softcover/mathjax.rb,
lib/softcover/version.rb,
lib/softcover/uploader.rb,
lib/softcover/sanitizer.rb,
lib/softcover/builders/pdf.rb,
lib/softcover/builders/epub.rb,
lib/softcover/builders/html.rb,
lib/softcover/builders/mobi.rb,
lib/softcover/commands/auth.rb,
lib/softcover/rails/railtie.rb,
lib/softcover/commands/build.rb,
lib/softcover/commands/check.rb,
lib/softcover/commands/opener.rb,
lib/softcover/builders/preview.rb,
lib/softcover/commands/generator.rb,
lib/softcover/commands/deployment.rb,
lib/softcover/commands/epub_validator.rb

Defined Under Namespace

Modules: Builders, Commands, Directories, EpubUtils, Mathjax, Output, Sanitizer, Utils Classes: App, BaseConfig, Book, BookConfig, BookManifest, Builder, CLI, Client, Config, MarketingManifest, Railtie, Uploader

Constant Summary collapse

FORMATS =
%w{html epub mobi pdf}
BUILD_ALL_FORMATS =

mobi calls epub, which calls html, so “all formats” is just mobi & pdf.

%w{mobi pdf}
VERSION =
"1.1.6"

Constants included from Utils

Utils::UNITS

Instance Method Summary collapse

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, #get_filename, #in_book_directory?, #language_labels, #linux?, #logged_in?, #master_content, #master_filename, #master_latex_header, #mkdir, #non_comment_lines, #os_x?, #path, #raw_lines, #reset_current_book!, #rm, #rm_r, #silence, #source, #template_dir, #tmpify, #unpublish_slug, #write_master_latex_file, #write_pygments_file

Instance Method Details

#custom_stylesObject

Return the custom styles, if any.



49
50
51
52
# File 'lib/softcover.rb', line 49

def custom_styles
  custom_file = File.join(Softcover::Directories::STYLES, 'custom.sty')
  File.exist?(custom_file) ? File.read(custom_file) : ''
end

#profiling?Boolean

Returns:

  • (Boolean)


62
63
64
65
# File 'lib/softcover.rb', line 62

def profiling?
  return false if test?
  @profiling
end

#set_test_mode!Object



54
55
56
# File 'lib/softcover.rb', line 54

def set_test_mode!
  @test_mode = true
end

#test?Boolean

Returns:

  • (Boolean)


58
59
60
# File 'lib/softcover.rb', line 58

def test?
  @test_mode
end