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/exercises.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.10.4"

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, #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

Instance Method Details

#custom_stylesObject

Return the custom styles, if any.



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

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)


65
66
67
68
# File 'lib/softcover.rb', line 65

def profiling?
  return false if test?
  @profiling
end

#set_test_mode!Object



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

def set_test_mode!
  @test_mode = true
end

#test?Boolean

Returns:

  • (Boolean)


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

def test?
  @test_mode
end