Sha256: 523259953e92c6b79c374987cbaedb63cd299df2897e207b9eb01b41949fb280
Contents?: true
Size: 517 Bytes
Versions: 10
Compression:
Stored size: 517 Bytes
Contents
require 'fileutils' def epub! out = _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
10 entries across 10 versions & 1 rubygems