bookify 2.6.0 → 2.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bookify/node/base.rb +3 -3
- data/lib/bookify/node/h1.rb +2 -2
- data/lib/bookify/node/h2.rb +3 -2
- data/lib/bookify/node/h3.rb +6 -3
- data/lib/bookify/node/h4.rb +6 -3
- data/lib/bookify/node/table.rb +9 -8
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d51ebed7b740e8227ef917d1cb77b8b69697a3897679be78fc7e0d75224eab1a
|
4
|
+
data.tar.gz: 0e39ed24007b1ed3385ee72505d6060c3fa484b8b6cc54af9629355e935d122a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9db685fcb9815e6888ed42b92c5c4c3d3b36536d689c31d7fbe0cd2b54657f46ffbad78189943e1ac31655c4a793ec2320c674eb89951b07e4cb0523df19a433
|
7
|
+
data.tar.gz: c69cc884d4af8bb320208932ddb6e68bdc848143cbcdfd19143a9e8dace6db447771734d2ceb715d3926ee52c91fdef0a83b57c48e5d243f3d0d62240922f00c
|
data/lib/bookify/node/base.rb
CHANGED
@@ -3,10 +3,10 @@ module Bookify::Node
|
|
3
3
|
attr_accessor :node, :pdf
|
4
4
|
|
5
5
|
FONTS = {
|
6
|
-
h1: ["Book Antiqua", size:
|
6
|
+
h1: ["Book Antiqua", size: 18, style: :bold],
|
7
7
|
h2: ["Book Antiqua", size: 12, style: :bold],
|
8
|
-
h3: ["Book Antiqua", size:
|
9
|
-
h4: ["Book Antiqua", size:
|
8
|
+
h3: ["Book Antiqua", size: 12, style: :bold],
|
9
|
+
h4: ["Book Antiqua", size: 11, style: :bold],
|
10
10
|
primary: ["Book Antiqua", size: 10]
|
11
11
|
}
|
12
12
|
|
data/lib/bookify/node/h1.rb
CHANGED
@@ -4,7 +4,7 @@ module Bookify::Node
|
|
4
4
|
class H1 < Base
|
5
5
|
def render
|
6
6
|
break_if_close_to_bottom(250)
|
7
|
-
move_down
|
7
|
+
move_down 30 unless pdf.y == page_top
|
8
8
|
|
9
9
|
html = decode_html(node.inner_html.strip)
|
10
10
|
dest = dest_xyz(0, pdf.y, nil, pdf.page)
|
@@ -16,7 +16,7 @@ module Bookify::Node
|
|
16
16
|
text html, align: :center
|
17
17
|
end
|
18
18
|
|
19
|
-
move_down
|
19
|
+
move_down 30
|
20
20
|
end
|
21
21
|
|
22
22
|
def page_top
|
data/lib/bookify/node/h2.rb
CHANGED
data/lib/bookify/node/h3.rb
CHANGED
@@ -3,11 +3,14 @@ require_relative "base"
|
|
3
3
|
module Bookify::Node
|
4
4
|
class H3 < Base
|
5
5
|
def render
|
6
|
-
font :h3
|
7
6
|
move_down 5
|
8
7
|
break_if_close_to_bottom
|
9
|
-
|
10
|
-
|
8
|
+
|
9
|
+
font :h3 do
|
10
|
+
text decode_html(node.inner_html.strip)
|
11
|
+
end
|
12
|
+
|
13
|
+
move_down 5
|
11
14
|
end
|
12
15
|
end
|
13
16
|
end
|
data/lib/bookify/node/h4.rb
CHANGED
data/lib/bookify/node/table.rb
CHANGED
@@ -5,19 +5,20 @@ module Bookify::Node
|
|
5
5
|
def render
|
6
6
|
font :primary
|
7
7
|
|
8
|
-
|
8
|
+
options = {
|
9
|
+
header: true,
|
10
|
+
width: bounds.width,
|
11
|
+
row_colors: ["FFFFFF", "EEEEEE"]
|
12
|
+
}
|
13
|
+
|
14
|
+
table table_data, options do
|
9
15
|
cells.borders = []
|
10
16
|
|
11
|
-
row(0).borders = [:
|
12
|
-
row(0).border_top_width = 0.5
|
17
|
+
row(0).borders = [:bottom]
|
13
18
|
row(0).border_bottom_width = 0.5
|
14
19
|
row(0).font_style = :bold
|
15
20
|
|
16
|
-
|
17
|
-
row(-1).border_bottom_width = 0.5
|
18
|
-
|
19
|
-
cells.columns(0).padding = [5, 5, 5, 0]
|
20
|
-
cells.columns(-1).padding = [5, 0, 5, 5]
|
21
|
+
cells.padding = 5
|
21
22
|
end
|
22
23
|
|
23
24
|
move_down 15
|