verku 0.15.0 → 0.16.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 33c19a92b0abfb0deafdfbc191739479542df70b
4
- data.tar.gz: d29fec1bc639fe247f3592b615a11be143d457a5
3
+ metadata.gz: a8ebb6f690d5fa191b46a1fcefed79fa0ac39cbf
4
+ data.tar.gz: b5d132a61f9584fb205a383db0bfb8ecccf3b939
5
5
  SHA512:
6
- metadata.gz: 26511d876bb09207ccb015e5a93ab5b0355a7d781edb9617826f5466cd234e0d8b68b68af1e0508fd60a56b1f48d1e33248ba14a16b6e211affaa5bc8d0976d7
7
- data.tar.gz: 9e979b24a2d8aee3692fec0a826406b21c2520627cdc65c0b2d0c963f8dc331977f856615200f7f06ef10023e6cbeec012b21c9f250f6864b1a6dd396267eec9
6
+ metadata.gz: d8443121ca7cd78c9a3931a08e0bfbae2bf81a7412682b901c636d84895553811d7416585807f88456a430cc4a0a011ef287cfe1632a62a2f317d677ff7fc381
7
+ data.tar.gz: b7a1b2845ffe65b60a3b94f2f4974e67df989e737318f303fb0c0664d3906ccb5165b3a91133652226b1a3b214d24971cbad50985469186f07be58d979c3bd7a
data/.rvmrc CHANGED
@@ -0,0 +1 @@
1
+ rvm use 2.3.1
data/Gemfile.lock CHANGED
@@ -1,14 +1,13 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- verku (0.15.0)
4
+ verku (0.16.0)
5
5
  activesupport (~> 5.0, >= 5.0.0)
6
6
  awesome_print (~> 0)
7
7
  eeepub (~> 0)
8
- kramdown (~> 0)
9
8
  nokogiri (~> 1.6, >= 1.6.0)
10
9
  notifier (~> 0)
11
- psych (~> 1.0)
10
+ pandoc-ruby
12
11
  rubyzip (~> 1.0, >= 1.0.0)
13
12
  safe_yaml (~> 1.0)
14
13
  thor (~> 0.19, >= 0.19.1)
@@ -17,31 +16,30 @@ PATH
17
16
  GEM
18
17
  remote: http://rubygems.org/
19
18
  specs:
20
- activesupport (5.0.0.1)
19
+ activesupport (5.1.4)
21
20
  concurrent-ruby (~> 1.0, >= 1.0.2)
22
21
  i18n (~> 0.7)
23
22
  minitest (~> 5.1)
24
23
  tzinfo (~> 1.1)
25
24
  awesome_print (0.4.0)
26
- builder (3.2.2)
27
- concurrent-ruby (1.0.2)
25
+ builder (3.2.3)
26
+ concurrent-ruby (1.0.5)
28
27
  eeepub (0.8.1)
29
28
  builder
30
29
  rubyzip
31
- i18n (0.7.0)
32
- kramdown (0.14.2)
33
- mini_portile2 (2.1.0)
34
- minitest (5.9.1)
35
- nokogiri (1.6.8.1)
36
- mini_portile2 (~> 2.1.0)
30
+ i18n (0.8.6)
31
+ mini_portile2 (2.3.0)
32
+ minitest (5.10.3)
33
+ nokogiri (1.8.1)
34
+ mini_portile2 (~> 2.3.0)
37
35
  notifier (0.5.2)
38
- psych (1.3.4)
39
- rake (11.3.0)
40
- rubyzip (1.2.0)
36
+ pandoc-ruby (2.0.2)
37
+ rake (12.1.0)
38
+ rubyzip (1.2.1)
41
39
  safe_yaml (1.0.4)
42
- thor (0.19.1)
43
- thread_safe (0.3.5)
44
- tzinfo (1.2.2)
40
+ thor (0.20.0)
41
+ thread_safe (0.3.6)
42
+ tzinfo (1.2.3)
45
43
  thread_safe (~> 0.1)
46
44
  zip-zip (0.3)
47
45
  rubyzip (>= 1.0.0)
@@ -55,4 +53,4 @@ DEPENDENCIES
55
53
  verku!
56
54
 
57
55
  BUNDLED WITH
58
- 1.13.6
56
+ 1.15.4
data/lib/verku/cli.rb CHANGED
@@ -5,7 +5,7 @@ module Verku
5
5
  class Cli < Thor
6
6
  FORMATS = %w[pdf draft proof html epub mobi txt]
7
7
  check_unknown_options!
8
-
8
+
9
9
  def self.exit_on_failure?
10
10
  true
11
11
  end
@@ -15,16 +15,16 @@ module Verku
15
15
  end
16
16
  super
17
17
  end
18
-
18
+
19
19
  desc "create", "Start new work"
20
20
  map %w(create new) => :create
21
21
  def create(path)
22
- puts "Verku -- A Million Monkeys Writing Your Masterpiece."
22
+ say "Verku -- A Million Monkeys Writing Your Masterpiece."
23
23
  generator = Generator.new
24
24
  generator.destination_root = path.squish.gsub(' ','-')
25
25
  generator.invoke_all
26
26
  end
27
-
27
+
28
28
  desc "compile [OPTIONS]", "Export e-book"
29
29
  map %w(compile export build) => :export
30
30
  method_option :only, :type => :string, :desc => "Can be one of: #{FORMATS.join(", ")}"
@@ -36,19 +36,19 @@ module Verku
36
36
  end
37
37
  Verku::Exporter.run(root_dir, options)
38
38
  end
39
-
39
+
40
40
  desc "pdf", "Export PDF only"
41
41
  def pdf
42
42
  inside_ebook!
43
43
  Verku::Exporter.run(root_dir, {:only => 'pdf'})
44
44
  end
45
-
45
+
46
46
  desc "version", "Prints the Verku's version information"
47
47
  map %w(-v --version) => :version
48
48
  def version
49
49
  say "Verku version #{Verku::VERSION}"
50
50
  end
51
-
51
+
52
52
  desc "stats", "Display some stats about your e-book"
53
53
  def stats
54
54
  inside_ebook!
@@ -4,10 +4,12 @@ require "English"
4
4
  module Verku
5
5
  class Exporter
6
6
  class Base
7
-
7
+
8
8
  attr_accessor :root_dir # The e-book directory.
9
9
  attr_accessor :source # Where the text files are stored.
10
-
10
+
11
+ EXTENSIONS = %w[markdown mkdown mkdn mkd md text]
12
+
11
13
  def handle_error(error)
12
14
  ui.say "#{error.class}: #{error.message}", :red
13
15
  ui.say error.backtrace.join("\n"), :white
@@ -19,23 +21,40 @@ module Verku
19
21
  def initialize(root_dir)
20
22
  @root_dir = Pathname.new(root_dir)
21
23
  @source = root_dir.join("text")
22
- # @build = Build.new
23
24
  end
24
25
 
25
26
  # Return directory's basename.
26
27
  def name
27
28
  File.basename(root_dir)
28
29
  end
30
+ def git_branch
31
+ branch = if (File.exist?(root_dir.join(".git/HEAD")))
32
+ File.read( root_dir.join(".git/HEAD") ).sub("ref: refs/heads/","").sub(/\n/,'')
33
+ else
34
+ "none"
35
+ end
36
+ return branch
37
+ end
38
+ def base_name(ext='')
39
+ oname = "#{name}-#{git_branch}"
40
+ end
41
+ def output_name(ext='txt')
42
+ root_dir.join("builds/#{base_name}.#{ext}")
43
+ end
29
44
 
30
45
  # Return the configuration file.
31
46
  def config
32
47
  Verku.config(root_dir)
33
48
  end
34
- # def build_data
35
- # Verku.build(root_dir)
36
- # end
49
+ def build_data
50
+ source_list.each do |file|
51
+ data = read_content(file)[1]
52
+ end
53
+ end
54
+
37
55
  def source_list
38
- @source_list ||= SourceList.new(root_dir)
56
+ # @source_list ||= SourceList.new(root_dir)
57
+ @source_list ||= Dir.glob("#{@root_dir.join('text')}/**/*.{#{EXTENSIONS.join(",")}}")
39
58
  end
40
59
  def render_template(file, locals = {})
41
60
  ERB.new(File.read(file)).result OpenStruct.new(locals).instance_eval{ binding }
@@ -43,15 +62,22 @@ module Verku
43
62
  def ui
44
63
  @ui ||= Thor::Base.shell.new
45
64
  end
65
+ def html_file
66
+ output_name("html")
67
+ end
68
+ def epub_file
69
+ output_name("epub")
70
+ end
71
+ def tex_file
72
+ output_name("tex")
73
+ end
46
74
  def read_content(file)
47
75
  content = File.read(file)
48
76
  data = {}
49
77
  begin
50
78
  # YAML_FRONT_MATTER_REGEXP = /\A(---\s*\n.*?\n?)^((---|\.\.\.)\s*$\n?)/m
51
79
  if content =~ /\A(---\s*\n.*?\n?)^((---|\.\.\.)\s*$\n?)/m
52
- # content = "\n#{$'}\n"
53
80
  content = $POSTMATCH
54
- # data = SafeYAML.load($1)
55
81
  data = YAML.load($1, :safe => true)
56
82
  end
57
83
  return [content, data]
@@ -3,17 +3,17 @@ module Verku
3
3
  class Exporter
4
4
  class Epub < Base
5
5
  def sections
6
- @sections ||= html.css("div.chapter").each_with_index.map do |chapter, index|
6
+ @sections ||= html.css("div.section").each_with_index.map do |section, index|
7
7
  OpenStruct.new({
8
8
  :index => index,
9
9
  :filename => "section_#{index}.html",
10
10
  :filepath => tmp_dir.join("section_#{index}.html").to_s,
11
- :html => Nokogiri::HTML(chapter.inner_html)
11
+ :html => Nokogiri::HTML(section.inner_html)
12
12
  })
13
13
  end
14
14
  end
15
15
  def epub; @epub ||= EeePub.make ;end
16
- def html; @html ||= Nokogiri::HTML(html_path.read); end
16
+ def html; @html ||= Nokogiri::HTML(html_file.read); end
17
17
  def export!
18
18
  puts "-- Exporting EPUB"
19
19
  epub.title config["title"]
@@ -37,7 +37,7 @@ module Verku
37
37
  epub.files cover_page + thanks_page + sections.map(&:filepath) + back_page + copyright_page + assets
38
38
  epub.nav navigation
39
39
 
40
- epub.save(epub_path)
40
+ epub.save(epub_file)
41
41
  true
42
42
  rescue Exception
43
43
  p $!, $@
@@ -65,8 +65,6 @@ module Verku
65
65
  def write_coverpage!
66
66
  contents = render_template(root_dir.join("_templates/epub/cover.html"), config)
67
67
  puts "Writing cover page. #{cover_path}"
68
- #
69
- # raise File.dirname(cover_path).inspect
70
68
  FileUtils.mkdir_p(File.dirname(cover_path))
71
69
  File.open(cover_path,"w") do |file|
72
70
  file << contents
@@ -74,7 +72,6 @@ module Verku
74
72
  end
75
73
  def write_copyright!
76
74
  contents = render_template(root_dir.join("_templates/html/copyright.erb"), config)
77
- # File.open('help.html','w').write(contents)
78
75
  FileUtils.mkdir_p(File.dirname(copyright_path))
79
76
  File.open(copyright_path,"w") do |file|
80
77
  file << contents
@@ -82,7 +79,6 @@ module Verku
82
79
  end
83
80
  def write_thankspage!
84
81
  contents = render_template(root_dir.join("_templates/html/thanks.erb"), config)
85
- # File.open('help.html','w').write(contents)
86
82
  FileUtils.mkdir_p(File.dirname(thanks_path))
87
83
  File.open(thanks_path,"w") do |file|
88
84
  file << contents
@@ -158,12 +154,6 @@ module Verku
158
154
  def template_path
159
155
  root_dir.join("_templates/epub/page.erb")
160
156
  end
161
- def html_path
162
- root_dir.join("builds/#{name}.html")
163
- end
164
- def epub_path
165
- root_dir.join("builds/#{name}.epub")
166
- end
167
157
  def tmp_dir
168
158
  root_dir.join("builds/tmp")
169
159
  end
@@ -1,11 +1,8 @@
1
- require 'kramdown'
2
- require "awesome_print"
3
-
4
1
  module Verku
5
2
  class Exporter
6
3
  class HTML < Base
7
4
  def export!
8
- locals = config.merge({ :contents => content })
5
+ locals = config.merge({ "contents" => content })
9
6
  locals['copyright'].gsub!("(C)", "&copy;")
10
7
  output = render_template(root_dir.join("_templates/html/layout.erb"), locals)
11
8
  File.open(root_dir.join(html_file), 'w').write(output)
@@ -18,28 +15,11 @@ module Verku
18
15
 
19
16
  private
20
17
  def content
21
- content = String.new
22
- source_list.each_chapter do |files|
23
- content << render_chapter(files)
24
- end
25
- return content
26
- end
27
- def render_file(file)
28
- data = read_content(file)
29
- content = "#{data[0]}".to_html
30
- return content
31
- end
32
- def render_chapter(files)
33
- chapter = String.new
34
- String.new.tap do
35
- files.each do |file|
36
- chapter << render_file(file) << "\n\n"
37
- end
38
- end
39
- return "<div class='chapter'>\n\t#{chapter}\n</div>"
40
- end
41
- def html_file
42
- root_dir.join("builds/#{name}.html")
18
+ source_list.map do |file|
19
+ d = File.read_content(file)
20
+ raise d.inspect
21
+ PandocRuby.markdown(read_content(file)[0]).to_html.sectionize
22
+ end.join("\n\n")
43
23
  end
44
24
  end
45
25
  end
@@ -9,9 +9,6 @@ module Verku
9
9
  p $!, $@
10
10
  false
11
11
  end
12
- def epub_file
13
- root_dir.join("builds/#{name}.epub")
14
- end
15
12
  end
16
13
  end
17
14
  end
@@ -9,7 +9,7 @@ module Verku
9
9
  locals['copyright'].gsub!("(C)", "\\copyright{}")
10
10
  output = render_template(root_dir.join("_templates/pdf/layout.erb"), locals)
11
11
  File.open(root_dir.join(tex_file), 'w').write(output)
12
-
12
+
13
13
  puts "-- Exporting PDF"
14
14
  puts " - Pass 1"; spawn_command ["xelatex", tex_file.to_s,]
15
15
  puts " - Pass 2"; spawn_command ["xelatex", tex_file.to_s,]
@@ -17,13 +17,13 @@ module Verku
17
17
  if config['status'] == 'final'
18
18
  puts " - Pass 3 - Indexing"
19
19
  spawn_command ["makeindex #{name}.idx"]
20
- # spawn_command ["makeglossaries #{name}.glo"]
20
+ spawn_command ["makeglossaries #{name}.glo"] if File.exist?("#{name}.glo")
21
21
  spawn_command ["xelatex", tex_file.to_s,]
22
22
  spawn_command ["rm *ilg *ind "]
23
23
  end
24
-
24
+
25
25
  spawn_command ["rm *.glo *.idx *.log *.out *.toc *aux *ist"]
26
- spawn_command ["mv #{name}.pdf builds/#{name}.pdf"]
26
+ spawn_command ["mv #{base_name("pdf")}.pdf #{output_name("pdf")}"]
27
27
  true
28
28
 
29
29
  rescue Exception => error
@@ -32,34 +32,10 @@ module Verku
32
32
  end
33
33
 
34
34
  private
35
- def render_file(file)
36
- data = read_content(file)
37
- h = nil
38
-
39
- if config["headers"].is_a? Array
40
- h = config["headers"][0..5]
41
- end
42
-
43
- return "#{data[0]}".to_latex(h)
44
- end
45
35
  def content
46
- content = String.new
47
- source_list.each_chapter do |files|
48
- content << render_chapter(files)
49
- end
50
- return content
51
- end
52
- def render_chapter(files)
53
- chapter = String.new
54
- String.new.tap do
55
- files.each do |file|
56
- chapter << render_file(file) << "\n\n"
57
- end
58
- end
59
- return chapter
60
- end
61
- def tex_file
62
- root_dir.join("builds/#{name}.tex")
36
+ source_list.map do |file|
37
+ PandocRuby.markdown(read_content(file)[0], :chapters).to_latex.fix_scenebreaks
38
+ end.join("\n\n")
63
39
  end
64
40
  end
65
41
  end
@@ -1 +1 @@
1
- txt.rb
1
+ # txt.rb
@@ -36,8 +36,8 @@ module Verku
36
36
  export_txt = [nil, "txt"].include?(options[:only])
37
37
 
38
38
  exported = []
39
- exported << PDF.export!(root_dir) if export_pdf && Dependency.xelatex?# && Dependency.prince?
40
- exported << HTML.export!(root_dir) if export_html
39
+ exported << PDF.export!(root_dir) if export_pdf && Dependency.xelatex?
40
+ exported << HTML.export!(root_dir) if export_html
41
41
  epub_done = Epub.export!(root_dir) if export_epub
42
42
  exported << epub_done
43
43
  exported << Mobi.export!(root_dir) if export_mobi && epub_done && Dependency.kindlegen?
@@ -8,14 +8,22 @@ class String
8
8
  str.downcase!
9
9
  str
10
10
  end
11
- def to_latex(headers=nil)
12
- headers = %w{chapter section subsection subsubsection paragraph subparagraph} if headers.nil?
13
- require 'kramdown'
14
- s = Kramdown::Document.new(self.dup, :latex_headers => headers).to_latex
15
- s << "\\pbreak{}"
11
+ def fix_scenebreaks
12
+ str = ActiveSupport::Multibyte::Chars.new(self.dup)
13
+ str.gsub('\begin{center}\rule{0.5\linewidth}{\linethickness}\end{center}','\pfbreak')
16
14
  end
17
- def to_html
18
- require 'kramdown'
19
- Kramdown::Document.new(self.dup).to_html
15
+ def sectionize
16
+ str = ActiveSupport::Multibyte::Chars.new(self.dup)
17
+ "<div class='section'>#{str}</div>"
20
18
  end
19
+ # def to_latex(headers=nil)
20
+ # headers = %w{chapter section subsection subsubsection paragraph subparagraph} if headers.nil?
21
+ # require 'kramdown'
22
+ # s = Kramdown::Document.new(self.dup, :latex_headers => headers).to_latex
23
+ # s << "\\pbreak{}"
24
+ # end
25
+ # def to_html
26
+ # require 'kramdown'
27
+ # Kramdown::Document.new(self.dup).to_html
28
+ # end
21
29
  end
@@ -10,7 +10,7 @@ module Verku
10
10
 
11
11
  # List of recognized extensions.
12
12
  #
13
- EXTENSIONS = %w[md markdown text]
13
+ EXTENSIONS = %w[markdown mkdown mkdn mkd md text]
14
14
 
15
15
  attr_reader :root_dir
16
16
  attr_reader :source
@@ -39,12 +39,12 @@ module Verku
39
39
  if File.file?(entry)
40
40
  [entry]
41
41
  else
42
+ # markdown,mkdown,mkdn,mkd,md
42
43
  Dir["#{entry}/**/*.{#{EXTENSIONS.join(",")}}"].sort
43
44
  end
44
45
  end
45
46
 
46
47
  # Return a list of all recognized files.
47
- #
48
48
  def entries
49
49
  Dir.entries(source).sort.each_with_object([]) do |entry, buffer|
50
50
  buffer << source.join(entry) if valid_entry?(entry)
@@ -53,7 +53,6 @@ module Verku
53
53
 
54
54
  # Check if path is a valid entry.
55
55
  # Files/directories that start with a dot or underscore will be skipped.
56
- #
57
56
  def valid_entry?(entry)
58
57
  entry !~ /^(\.|_)/ && (valid_directory?(entry) || valid_file?(entry))
59
58
  end
data/lib/verku/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Verku
2
- VERSION = '0.15.0'
2
+ VERSION = '0.16.0'
3
3
  # module Version
4
4
  # MAJOR = 0
5
5
  # MINOR = 9
data/lib/verku.rb CHANGED
@@ -11,6 +11,7 @@ require "open3"
11
11
  require "optparse"
12
12
  require "ostruct"
13
13
  require "tempfile"
14
+ require "pandoc-ruby"
14
15
  require "pathname"
15
16
  require "thor"
16
17
  require "thor/group"
@@ -34,15 +35,12 @@ module Verku
34
35
  require "verku/exporter/mobi"
35
36
 
36
37
  require "verku/generator"
37
- require "verku/adapters/markdown"
38
- # require "verku/parser"
39
- require "verku/source_list"
38
+ # require "verku/source_list"
40
39
  require "verku/stats"
41
40
  require "verku/stream"
42
- # require "verku/structure"
43
41
  require "verku/toc"
44
42
  require 'verku/version'
45
-
43
+
46
44
  Encoding.default_internal = "utf-8"
47
45
  Encoding.default_external = "utf-8"
48
46
 
@@ -53,8 +51,8 @@ module Verku
53
51
  raise "Invalid Verku directory; couldn't found #{path} file." unless File.file?(path)
54
52
  content = File.read(path)
55
53
  erb = ERB.new(content).result
54
+ SafeYAML::OPTIONS[:default_mode] = true
56
55
  YAML.load(erb, :safe => true)
57
- #YAML.load(erb)#.with_indifferent_access
58
56
  end
59
57
  def self.logger
60
58
  @logger ||= Logger.new(File.open("/tmp/verku.log", "a"))
data/verku.gemspec CHANGED
@@ -7,7 +7,6 @@ Gem::Specification.new do |spec|
7
7
  spec.name = "verku"
8
8
  spec.version = Verku::VERSION
9
9
 
10
- # spec.required_rubygems_version = Gem::Requirement.new("~> 0") if spec.respond_to? :required_rubygems_version=
11
10
  spec.require_paths = ["lib"]
12
11
  spec.authors = ["Merovex"]
13
12
  spec.description = "Verku provides authors a free, ruby-based production toolchain for self-published paper and electronic books using the LaTeX document preparation system."
@@ -21,75 +20,24 @@ Gem::Specification.new do |spec|
21
20
  "README.md"
22
21
  ]
23
22
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
24
-
23
+
25
24
  spec.rubyforge_project = "verku"
26
25
  spec.rubygems_version = "2.2.2"
27
- spec.summary = "Verku is a Ruby & LaTeX based production toolchain for self-publishers."
26
+ spec.summary = "Verku is a Ruby-/Markdown-/LaTeX-based production tool chain for self-publishers."
28
27
  spec.test_files = ["test/helper.rb", "test/test_bookmaker.rb"]
29
28
 
30
29
  spec.add_development_dependency "bundler", "~> 1.12"
31
30
  spec.add_development_dependency "rake", "~> 10.0"
32
31
 
33
- spec.add_runtime_dependency "kramdown", "~> 0"
34
- spec.add_runtime_dependency "psych", "~> 1.0"
35
32
  spec.add_runtime_dependency "activesupport", "~> 5.0", ">= 5.0.0"
36
- spec.add_runtime_dependency "rubyzip", "~> 1.0", ">= 1.0.0"
37
- spec.add_runtime_dependency "zip-zip", "~> 0"
33
+ spec.add_runtime_dependency "awesome_print", "~> 0"
38
34
  spec.add_runtime_dependency "eeepub", "~> 0"
39
- # spec.add_runtime_dependency "thor", ">= 0.19.1"
40
- spec.add_runtime_dependency 'thor', "~> 0.19", ">= 0.19.1"
41
35
  spec.add_runtime_dependency "nokogiri", "~> 1.6", ">= 1.6.0"
42
36
  spec.add_runtime_dependency "notifier", "~> 0"
43
- spec.add_runtime_dependency "awesome_print", "~> 0"
37
+ spec.add_runtime_dependency 'pandoc-ruby'
38
+ spec.add_runtime_dependency "rubyzip", "~> 1.0", ">= 1.0.0"
44
39
  spec.add_runtime_dependency "safe_yaml", "~> 1.0"
40
+ spec.add_runtime_dependency 'thor', "~> 0.19", ">= 0.19.1"
41
+ spec.add_runtime_dependency "zip-zip", "~> 0"
45
42
 
46
- # if spec.respond_to? :specification_version then
47
- # spec.specification_version = 4
48
-
49
- # if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
50
- # spec.add_development_dependency(%q<shoulda>, ["~> 0"])
51
- # spec.add_development_dependency(%q<rdoc>, ["~> 3.12"])
52
- # spec.add_development_dependency(%q<bundler>, ["~> 1.0"])
53
- # spec.add_development_dependency(%q<simplecov>, ["~> 0"])
54
-
55
- # spec.add_development_dependency(%q<aruba>, ["~> 0"])
56
- # spec.add_development_dependency(%q<cucumber>, ["~> 0"])
57
- # else
58
- # spec.add_dependency(%q<shoulda>, ["~> 0"])
59
- # spec.add_dependency(%q<rdoc>, ["~> 3.12"])
60
- # spec.add_dependency(%q<bundler>, ["~> 1.0"])
61
-
62
- # spec.add_dependency(%q<simplecov>, ["~> 0"])
63
- # spec.add_dependency(%q<activesupport>, ["~> 0"])
64
- # spec.add_dependency(%q<aruba>, ["~> 0"])
65
- # spec.add_dependency(%q<cucumber>, ["~> 0"])
66
- # spec.add_dependency(%q<rubyzip>, ["~> 0"])
67
- # spec.add_dependency(%q<zip-zip>, ["~> 0"])
68
- # spec.add_dependency(%q<eeepub>, ["~> 0"])
69
- # spec.add_dependency(%q<kramdown>, ["~> 0"])
70
- # spec.add_dependency(%q<thor>, ["~> 0"])
71
- # spec.add_dependency(%q<nokogiri>, ["~> 0"])
72
- # spec.add_dependency(%q<notifier>, ["~> 0"])
73
- # spec.add_dependency(%q<awesome_print>, ["~> 0"])
74
- # spec.add_dependency(%q<safe_yaml>, ["~> 0"])
75
- # end
76
- # else
77
- # spec.add_dependency(%q<shoulda>, ["~> 0"])
78
- # spec.add_dependency(%q<rdoc>, ["~> 3.12"])
79
- # spec.add_dependency(%q<bundler>, ["~> 1.0"])
80
- # spec.add_dependency(%q<simplecov>, ["~> 0"])
81
- # spec.add_dependency(%q<activesupport>, ["~> 0"])
82
- # spec.add_dependency(%q<aruba>, ["~> 0"])
83
- # spec.add_dependency(%q<cucumber>, ["~> 0"])
84
- # spec.add_dependency(%q<rubyzip>, ["~> 0"])
85
- # spec.add_dependency(%q<zip-zip>, ["~> 0"])
86
- # spec.add_dependency(%q<eeepub>, ["~> 0"])
87
- # spec.add_dependency(%q<kramdown>, ["~> 0"])
88
- # spec.add_dependency(%q<thor>, ["~> 0"])
89
- # spec.add_dependency(%q<nokogiri>, ["~> 0"])
90
- # spec.add_dependency(%q<notifier>, ["~> 0"])
91
- # spec.add_dependency(%q<awesome_print>, ["~> 0"])
92
- # spec.add_dependency(%q<safe_yaml>, ["~> 0"])
93
- # end
94
43
  end
95
-
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: verku
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.0
4
+ version: 0.16.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Merovex
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-06 00:00:00.000000000 Z
11
+ date: 2017-10-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -39,75 +39,75 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: '10.0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: kramdown
42
+ name: activesupport
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '0'
47
+ version: '5.0'
48
+ - - ">="
49
+ - !ruby/object:Gem::Version
50
+ version: 5.0.0
48
51
  type: :runtime
49
52
  prerelease: false
50
53
  version_requirements: !ruby/object:Gem::Requirement
51
54
  requirements:
52
55
  - - "~>"
53
56
  - !ruby/object:Gem::Version
54
- version: '0'
57
+ version: '5.0'
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: 5.0.0
55
61
  - !ruby/object:Gem::Dependency
56
- name: psych
62
+ name: awesome_print
57
63
  requirement: !ruby/object:Gem::Requirement
58
64
  requirements:
59
65
  - - "~>"
60
66
  - !ruby/object:Gem::Version
61
- version: '1.0'
67
+ version: '0'
62
68
  type: :runtime
63
69
  prerelease: false
64
70
  version_requirements: !ruby/object:Gem::Requirement
65
71
  requirements:
66
72
  - - "~>"
67
73
  - !ruby/object:Gem::Version
68
- version: '1.0'
74
+ version: '0'
69
75
  - !ruby/object:Gem::Dependency
70
- name: activesupport
76
+ name: eeepub
71
77
  requirement: !ruby/object:Gem::Requirement
72
78
  requirements:
73
79
  - - "~>"
74
80
  - !ruby/object:Gem::Version
75
- version: '5.0'
76
- - - ">="
77
- - !ruby/object:Gem::Version
78
- version: 5.0.0
81
+ version: '0'
79
82
  type: :runtime
80
83
  prerelease: false
81
84
  version_requirements: !ruby/object:Gem::Requirement
82
85
  requirements:
83
86
  - - "~>"
84
87
  - !ruby/object:Gem::Version
85
- version: '5.0'
86
- - - ">="
87
- - !ruby/object:Gem::Version
88
- version: 5.0.0
88
+ version: '0'
89
89
  - !ruby/object:Gem::Dependency
90
- name: rubyzip
90
+ name: nokogiri
91
91
  requirement: !ruby/object:Gem::Requirement
92
92
  requirements:
93
93
  - - "~>"
94
94
  - !ruby/object:Gem::Version
95
- version: '1.0'
95
+ version: '1.6'
96
96
  - - ">="
97
97
  - !ruby/object:Gem::Version
98
- version: 1.0.0
98
+ version: 1.6.0
99
99
  type: :runtime
100
100
  prerelease: false
101
101
  version_requirements: !ruby/object:Gem::Requirement
102
102
  requirements:
103
103
  - - "~>"
104
104
  - !ruby/object:Gem::Version
105
- version: '1.0'
105
+ version: '1.6'
106
106
  - - ">="
107
107
  - !ruby/object:Gem::Version
108
- version: 1.0.0
108
+ version: 1.6.0
109
109
  - !ruby/object:Gem::Dependency
110
- name: zip-zip
110
+ name: notifier
111
111
  requirement: !ruby/object:Gem::Requirement
112
112
  requirements:
113
113
  - - "~>"
@@ -121,75 +121,75 @@ dependencies:
121
121
  - !ruby/object:Gem::Version
122
122
  version: '0'
123
123
  - !ruby/object:Gem::Dependency
124
- name: eeepub
124
+ name: pandoc-ruby
125
125
  requirement: !ruby/object:Gem::Requirement
126
126
  requirements:
127
- - - "~>"
127
+ - - ">="
128
128
  - !ruby/object:Gem::Version
129
129
  version: '0'
130
130
  type: :runtime
131
131
  prerelease: false
132
132
  version_requirements: !ruby/object:Gem::Requirement
133
133
  requirements:
134
- - - "~>"
134
+ - - ">="
135
135
  - !ruby/object:Gem::Version
136
136
  version: '0'
137
137
  - !ruby/object:Gem::Dependency
138
- name: thor
138
+ name: rubyzip
139
139
  requirement: !ruby/object:Gem::Requirement
140
140
  requirements:
141
141
  - - "~>"
142
142
  - !ruby/object:Gem::Version
143
- version: '0.19'
143
+ version: '1.0'
144
144
  - - ">="
145
145
  - !ruby/object:Gem::Version
146
- version: 0.19.1
146
+ version: 1.0.0
147
147
  type: :runtime
148
148
  prerelease: false
149
149
  version_requirements: !ruby/object:Gem::Requirement
150
150
  requirements:
151
151
  - - "~>"
152
152
  - !ruby/object:Gem::Version
153
- version: '0.19'
153
+ version: '1.0'
154
154
  - - ">="
155
155
  - !ruby/object:Gem::Version
156
- version: 0.19.1
156
+ version: 1.0.0
157
157
  - !ruby/object:Gem::Dependency
158
- name: nokogiri
158
+ name: safe_yaml
159
159
  requirement: !ruby/object:Gem::Requirement
160
160
  requirements:
161
161
  - - "~>"
162
162
  - !ruby/object:Gem::Version
163
- version: '1.6'
164
- - - ">="
165
- - !ruby/object:Gem::Version
166
- version: 1.6.0
163
+ version: '1.0'
167
164
  type: :runtime
168
165
  prerelease: false
169
166
  version_requirements: !ruby/object:Gem::Requirement
170
167
  requirements:
171
168
  - - "~>"
172
169
  - !ruby/object:Gem::Version
173
- version: '1.6'
174
- - - ">="
175
- - !ruby/object:Gem::Version
176
- version: 1.6.0
170
+ version: '1.0'
177
171
  - !ruby/object:Gem::Dependency
178
- name: notifier
172
+ name: thor
179
173
  requirement: !ruby/object:Gem::Requirement
180
174
  requirements:
181
175
  - - "~>"
182
176
  - !ruby/object:Gem::Version
183
- version: '0'
177
+ version: '0.19'
178
+ - - ">="
179
+ - !ruby/object:Gem::Version
180
+ version: 0.19.1
184
181
  type: :runtime
185
182
  prerelease: false
186
183
  version_requirements: !ruby/object:Gem::Requirement
187
184
  requirements:
188
185
  - - "~>"
189
186
  - !ruby/object:Gem::Version
190
- version: '0'
187
+ version: '0.19'
188
+ - - ">="
189
+ - !ruby/object:Gem::Version
190
+ version: 0.19.1
191
191
  - !ruby/object:Gem::Dependency
192
- name: awesome_print
192
+ name: zip-zip
193
193
  requirement: !ruby/object:Gem::Requirement
194
194
  requirements:
195
195
  - - "~>"
@@ -202,20 +202,6 @@ dependencies:
202
202
  - - "~>"
203
203
  - !ruby/object:Gem::Version
204
204
  version: '0'
205
- - !ruby/object:Gem::Dependency
206
- name: safe_yaml
207
- requirement: !ruby/object:Gem::Requirement
208
- requirements:
209
- - - "~>"
210
- - !ruby/object:Gem::Version
211
- version: '1.0'
212
- type: :runtime
213
- prerelease: false
214
- version_requirements: !ruby/object:Gem::Requirement
215
- requirements:
216
- - - "~>"
217
- - !ruby/object:Gem::Version
218
- version: '1.0'
219
205
  description: Verku provides authors a free, ruby-based production toolchain for self-published
220
206
  paper and electronic books using the LaTeX document preparation system.
221
207
  email:
@@ -239,7 +225,6 @@ files:
239
225
  - VERSION
240
226
  - bin/verku
241
227
  - lib/verku.rb
242
- - lib/verku/adapters/markdown.rb
243
228
  - lib/verku/build.rb
244
229
  - lib/verku/cli.rb
245
230
  - lib/verku/dependency.rb
@@ -309,10 +294,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
309
294
  version: '0'
310
295
  requirements: []
311
296
  rubyforge_project: verku
312
- rubygems_version: 2.6.6
297
+ rubygems_version: 2.6.11
313
298
  signing_key:
314
299
  specification_version: 4
315
- summary: Verku is a Ruby & LaTeX based production toolchain for self-publishers.
300
+ summary: Verku is a Ruby-/Markdown-/LaTeX-based production tool chain for self-publishers.
316
301
  test_files:
317
302
  - test/helper.rb
318
303
  - test/test_bookmaker.rb
@@ -1,44 +0,0 @@
1
- module Kitabu
2
- class Markdown
3
- # Supported Markdown libraries
4
- #
5
- MARKDOWN_LIBRARIES = %w[Kramdown]
6
-
7
- # Retrieve preferred Markdown processor.
8
- # You'll need one of the following libraries:
9
- #
10
- # # RDiscount: https://rubygems.org/gems/rdiscount
11
- # # Maruku: https://rubygems.org/gems/maruku
12
- # # PEGMarkdown: https://rubygems.org/gems/rpeg-markdown
13
- # # BlueCloth: https://rubygems.org/gems/bluecloth
14
- # # Redcarpet: https://rubygems.org/gems/redcarpet
15
- # # Kramdown: http://kramdown.rubyforge.org/
16
- #
17
- # Note: RDiscount will always be installed as Kitabu's dependency but only used when no
18
- # alternative library is available.
19
- #
20
- def self.engine
21
- @engine ||= Object.const_get(MARKDOWN_LIBRARIES.find {|lib| Object.const_defined?(lib)})
22
- end
23
-
24
- def self.to_latex(content)
25
- case engine.name
26
- when "Redcarpet"
27
- # render = Redcarpet::Render::HTML.new(:hard_wrap => true, :xhtml => true)
28
- # Redcarpet::Markdown.new(render).render(content)
29
- else
30
- engine.new(content).to_latex
31
- end
32
- end
33
- # Convert Markdown to HTML.
34
- def self.to_html(content)
35
- case engine.name
36
- when "Redcarpet"
37
- render = Redcarpet::Render::HTML.new(:hard_wrap => true, :xhtml => true)
38
- Redcarpet::Markdown.new(render).render(content)
39
- else
40
- engine.new(content).to_html
41
- end
42
- end
43
- end
44
- end