Sha256: 9a026a41cc4486ce70beeff05c174bde8e6262d194c83c5178acdcfb8fbcb824

Contents?: true

Size: 521 Bytes

Versions: 15

Compression:

Stored size: 521 Bytes

Contents

require 'fileutils'

def epub!
  out = _var_substitution(@_args[0])
  src = @_args[1]
  @cover = @_args[2]
  if ::File.directory?(src)
    files = ::Dir["#{src}/*"].grep /\.html$/
    cmd = "cat #{files.join(' ')} >TEMP.html"
    system(cmd)
  else
    raise "Not supported yet"
  end

  cmd = "ebook-convert "
  cmd << "TEMP.html #{out}.epub "
  cmd << "--cover #@cover " if @cover
  system(cmd)

  str = `links -dump TEMP.html | wc -w`
  nw = str.split[0]
  puts "Approx words: #{nw}"
  ::FileUtils.rm("TEMP.html")
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
livetext-0.6.9 ./dsl/calibre.rb
livetext-0.6.8 ./dsl/calibre.rb
livetext-0.6.7 ./dsl/calibre.rb
livetext-0.6.5 ./dsl/calibre.rb
livetext-0.6.4 ./dsl/calibre.rb
livetext-0.6.3 ./dsl/calibre.rb
livetext-0.6.2 ./dsl/calibre.rb
livetext-0.6.1 ./dsl/calibre.rb
livetext-0.6.0 ./dsl/calibre.rb
livetext-0.5.9 ./dsl/calibre.rb
livetext-0.5.8 ./dsl/calibre.rb
livetext-0.5.7 ./dsl/calibre.rb
livetext-0.5.6 ./lib/calibre.rb
livetext-0.5.4 ./lib/calibre.rb
livetext-0.5.3 ./lib/calibre.rb