kitabu 3.0.2 → 3.0.3
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/kitabu.gemspec +1 -1
- data/lib/kitabu/exporter/base.rb +4 -0
- data/lib/kitabu/exporter/css.rb +2 -0
- data/lib/kitabu/exporter/epub.rb +1 -0
- data/lib/kitabu/exporter/html.rb +1 -0
- data/lib/kitabu/exporter/mobi.rb +1 -0
- data/lib/kitabu/exporter/pdf.rb +1 -0
- data/lib/kitabu/extensions/rouge.rb +2 -0
- data/lib/kitabu/version.rb +1 -1
- data/spec/kitabu/exporter/mobi_spec.rb +1 -0
- data/spec/kitabu/markdown_spec.rb +11 -0
- data/spec/spec_helper.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7a15501f3e1767a56b549ee1ec0362330f1e06f9d09a30f45ee48ee7336b1331
|
|
4
|
+
data.tar.gz: e49ef66fd50e324a611f16671915905baf031fc0dc1d0ff7e0e56a14eaf6b62a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 65b392f97c0b51b1a5b863476b6d6a18ee5b4acf66e2d31fb48c43ef14044eaf30abe45169da2e52b84541f221435058a59c72b05c309e835f8cf6bd1b495642
|
|
7
|
+
data.tar.gz: d40bd333e9487e20b1467ab554c1d8b3162d02aed3383ec20cb25a6d64ac68e3570609ffae7c4deeb7b6c8a854a98893e088b51815880bd09b74a5d3b4557ed1
|
data/CHANGELOG.md
CHANGED
data/kitabu.gemspec
CHANGED
|
@@ -8,7 +8,7 @@ Gem::Specification.new do |s|
|
|
|
8
8
|
s.version = Kitabu::Version::STRING
|
|
9
9
|
s.platform = Gem::Platform::RUBY
|
|
10
10
|
s.authors = ["Nando Vieira"]
|
|
11
|
-
s.email = ["fnando.
|
|
11
|
+
s.email = ["me@fnando.com"]
|
|
12
12
|
s.homepage = "http://rubygems.org/gems/kitabu"
|
|
13
13
|
s.summary = "A framework for creating e-books from Markdown " \
|
|
14
14
|
"using Ruby. Using the Prince PDF generator, " \
|
data/lib/kitabu/exporter/base.rb
CHANGED
data/lib/kitabu/exporter/css.rb
CHANGED
data/lib/kitabu/exporter/epub.rb
CHANGED
data/lib/kitabu/exporter/html.rb
CHANGED
data/lib/kitabu/exporter/mobi.rb
CHANGED
data/lib/kitabu/exporter/pdf.rb
CHANGED
|
@@ -5,6 +5,8 @@ module Rouge
|
|
|
5
5
|
module Redcarpet
|
|
6
6
|
def rouge_formatter(lexer)
|
|
7
7
|
options = lexer.respond_to?(:options) ? lexer.options : {}
|
|
8
|
+
options = options.keys.map(&:to_sym).zip(options.values).to_h
|
|
9
|
+
options[:start_line] = options.fetch(:start_line, 1).to_i
|
|
8
10
|
|
|
9
11
|
Formatters::HTMLLegacy.new(
|
|
10
12
|
{css_class: "highlight #{lexer.tag}"}.merge(options)
|
data/lib/kitabu/version.rb
CHANGED
|
@@ -7,6 +7,7 @@ describe Kitabu::Exporter::Mobi, calibre: Kitabu::Dependency.calibre? do
|
|
|
7
7
|
root = SPECDIR.join("support/mybook")
|
|
8
8
|
|
|
9
9
|
Kitabu::Exporter::HTML.export(root)
|
|
10
|
+
Kitabu::Exporter::Epub.export(root)
|
|
10
11
|
Kitabu::Exporter::Mobi.export(root)
|
|
11
12
|
|
|
12
13
|
expect(root.join("output/mybook.mobi")).to be_file
|
|
@@ -24,6 +24,17 @@ describe Kitabu::Markdown do
|
|
|
24
24
|
expect(html).to include('<span class="k">echo</span>')
|
|
25
25
|
end
|
|
26
26
|
|
|
27
|
+
it "enables line numbers" do
|
|
28
|
+
html = Kitabu::Markdown.render <<-TEXT.strip_heredoc
|
|
29
|
+
```ruby?line_numbers=true
|
|
30
|
+
class User
|
|
31
|
+
end
|
|
32
|
+
```
|
|
33
|
+
TEXT
|
|
34
|
+
|
|
35
|
+
expect(html).to include(%[<table class="rouge-table">])
|
|
36
|
+
end
|
|
37
|
+
|
|
27
38
|
it "does not raise with unknown lexers" do
|
|
28
39
|
expect do
|
|
29
40
|
Kitabu::Markdown.render <<-TEXT.strip_heredoc
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: kitabu
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.0.
|
|
4
|
+
version: 3.0.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Nando Vieira
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2022-02-
|
|
11
|
+
date: 2022-02-20 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activesupport
|
|
@@ -224,7 +224,7 @@ description: A framework for creating e-books from Markdown using Ruby. Using th
|
|
|
224
224
|
Prince PDF generator, you'll be able to get high quality PDFs. Also supports EPUB,
|
|
225
225
|
Mobi, Text and HTML generation.
|
|
226
226
|
email:
|
|
227
|
-
- fnando.
|
|
227
|
+
- me@fnando.com
|
|
228
228
|
executables:
|
|
229
229
|
- kitabu
|
|
230
230
|
extensions: []
|