fnando-kitabu 0.3.6 → 0.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/kitabu.gemspec +5 -5
- data/lib/kitabu.rb +1 -1
- data/lib/kitabu/base.rb +19 -1
- data/lib/kitabu/tasks.rb +3 -3
- metadata +3 -3
data/Rakefile
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.7
|
data/kitabu.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{kitabu}
|
5
|
-
s.version = "0.3.
|
5
|
+
s.version = "0.3.7"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Nando Vieira"]
|
9
|
-
s.date = %q{2009-08-
|
9
|
+
s.date = %q{2009-08-13}
|
10
10
|
s.default_executable = %q{kitabu}
|
11
11
|
s.description = %q{A framework for creating e-books from Markdown/Textile text markup using Ruby.
|
12
12
|
Using the Prince PDF generator, you'll be able to get high quality PDFs.
|
@@ -59,14 +59,14 @@ Using the Prince PDF generator, you'll be able to get high quality PDFs.
|
|
59
59
|
s.specification_version = 3
|
60
60
|
|
61
61
|
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
62
|
-
s.add_runtime_dependency(%q<
|
62
|
+
s.add_runtime_dependency(%q<rdiscount>, [">= 0"])
|
63
63
|
s.add_runtime_dependency(%q<hpricot>, [">= 0"])
|
64
64
|
s.add_runtime_dependency(%q<unicode>, [">= 0"])
|
65
65
|
s.add_runtime_dependency(%q<main>, [">= 0"])
|
66
66
|
s.add_runtime_dependency(%q<ultraviolet>, [">= 0"])
|
67
67
|
s.add_runtime_dependency(%q<colorize>, [">= 0"])
|
68
68
|
else
|
69
|
-
s.add_dependency(%q<
|
69
|
+
s.add_dependency(%q<rdiscount>, [">= 0"])
|
70
70
|
s.add_dependency(%q<hpricot>, [">= 0"])
|
71
71
|
s.add_dependency(%q<unicode>, [">= 0"])
|
72
72
|
s.add_dependency(%q<main>, [">= 0"])
|
@@ -74,7 +74,7 @@ Using the Prince PDF generator, you'll be able to get high quality PDFs.
|
|
74
74
|
s.add_dependency(%q<colorize>, [">= 0"])
|
75
75
|
end
|
76
76
|
else
|
77
|
-
s.add_dependency(%q<
|
77
|
+
s.add_dependency(%q<rdiscount>, [">= 0"])
|
78
78
|
s.add_dependency(%q<hpricot>, [">= 0"])
|
79
79
|
s.add_dependency(%q<unicode>, [">= 0"])
|
80
80
|
s.add_dependency(%q<main>, [">= 0"])
|
data/lib/kitabu.rb
CHANGED
data/lib/kitabu/base.rb
CHANGED
@@ -3,6 +3,7 @@ module Kitabu
|
|
3
3
|
DEFAULT_LAYOUT = 'boom'
|
4
4
|
DEFAULT_THEME = 'eiffel'
|
5
5
|
DEFAULT_SYNTAX = 'plain_text'
|
6
|
+
DEFAULT_MARKDOWN_PROCESSOR = 'rdiscount'
|
6
7
|
GEM_ROOT = File.expand_path(File.dirname(__FILE__) + "/../../")
|
7
8
|
|
8
9
|
extend self
|
@@ -113,7 +114,7 @@ module Kitabu
|
|
113
114
|
if markup_file =~ /\.textile$/
|
114
115
|
markup = BlackCloth.new(markup_contents)
|
115
116
|
else
|
116
|
-
markup =
|
117
|
+
markup = markdown_processor_class.new(markup_contents)
|
117
118
|
end
|
118
119
|
rescue Exception => e
|
119
120
|
$stdout << "\nSkipping #{markup_file} (#{e.message})"
|
@@ -211,6 +212,23 @@ module Kitabu
|
|
211
212
|
DEFAULT_LAYOUT
|
212
213
|
end
|
213
214
|
|
215
|
+
def default_markdown_processor
|
216
|
+
DEFAULT_MARKDOWN_PROCESSOR
|
217
|
+
end
|
218
|
+
|
219
|
+
def markdown_processor
|
220
|
+
config['markdown'] || default_markdown_processor
|
221
|
+
end
|
222
|
+
|
223
|
+
def markdown_processor_class
|
224
|
+
case markdown_processor
|
225
|
+
when 'maruku' then Maruku
|
226
|
+
when 'bluecloth' then BlueCloth
|
227
|
+
when 'peg_markdown' then PEGMarkdown
|
228
|
+
else RDiscount
|
229
|
+
end
|
230
|
+
end
|
231
|
+
|
214
232
|
def syntaxes
|
215
233
|
Uv.syntaxes
|
216
234
|
end
|
data/lib/kitabu/tasks.rb
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
require "kitabu"
|
2
2
|
|
3
3
|
begin
|
4
|
-
require
|
4
|
+
require Kitabu::Base.markdown_processor.downcase
|
5
5
|
rescue LoadError => e
|
6
|
-
puts "\
|
7
|
-
"Install using `sudo gem install
|
6
|
+
puts "\n#{Kitabu::Base.markdown_processor} gem not found. NO MARKDOWN for you.\n" +
|
7
|
+
"Install using `sudo gem install #{Kitabu::Base.markdown_processor}`.\n"
|
8
8
|
end
|
9
9
|
|
10
10
|
require File.dirname(__FILE__) + "/redcloth"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fnando-kitabu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nando Vieira
|
@@ -9,11 +9,11 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-08-
|
12
|
+
date: 2009-08-13 00:00:00 -07:00
|
13
13
|
default_executable: kitabu
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
|
-
name:
|
16
|
+
name: rdiscount
|
17
17
|
type: :runtime
|
18
18
|
version_requirement:
|
19
19
|
version_requirements: !ruby/object:Gem::Requirement
|