bookify 2.6.0 → 2.7.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4255cf2b6bf6760ab6e48f513e5b72d39c76a524052a900801445462743cfd20
4
- data.tar.gz: d8ddad7073160d14d02bcfcc366f7067af49f0bd73edbaba0739ee3db0e2f57b
3
+ metadata.gz: d51ebed7b740e8227ef917d1cb77b8b69697a3897679be78fc7e0d75224eab1a
4
+ data.tar.gz: 0e39ed24007b1ed3385ee72505d6060c3fa484b8b6cc54af9629355e935d122a
5
5
  SHA512:
6
- metadata.gz: bfa67e29bf649746630e7352d5892d46616a9cd463ff937fd06dd6b5d4c69f870af036e33d993af1fd9a8ea49c2e80eb116da3c3191bdd5552a0e82f413375a2
7
- data.tar.gz: c37247ac47f1df3703933e78b546f6ccea7c6e10964abbad50b0a23e4460e335c167376aa5d03ca34832ef7ab93f27cc0f6c1077c67cc156618ecc29a9774fcd
6
+ metadata.gz: 9db685fcb9815e6888ed42b92c5c4c3d3b36536d689c31d7fbe0cd2b54657f46ffbad78189943e1ac31655c4a793ec2320c674eb89951b07e4cb0523df19a433
7
+ data.tar.gz: c69cc884d4af8bb320208932ddb6e68bdc848143cbcdfd19143a9e8dace6db447771734d2ceb715d3926ee52c91fdef0a83b57c48e5d243f3d0d62240922f00c
@@ -3,10 +3,10 @@ module Bookify::Node
3
3
  attr_accessor :node, :pdf
4
4
 
5
5
  FONTS = {
6
- h1: ["Book Antiqua", size: 16, style: :bold],
6
+ h1: ["Book Antiqua", size: 18, style: :bold],
7
7
  h2: ["Book Antiqua", size: 12, style: :bold],
8
- h3: ["Book Antiqua", size: 11, style: :bold],
9
- h4: ["Book Antiqua", size: 10, style: :bold],
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
 
@@ -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 20 unless pdf.y == page_top
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 10
19
+ move_down 30
20
20
  end
21
21
 
22
22
  def page_top
@@ -14,8 +14,9 @@ module Bookify::Node
14
14
  add_dest(html, dest)
15
15
  add_dest("#{parent_h1}/#{html}", dest) if parent_h1
16
16
 
17
- font :h2
18
- text html
17
+ font :h2 do
18
+ text html
19
+ end
19
20
 
20
21
  move_down 1
21
22
  stroke { horizontal_rule }
@@ -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
- text decode_html(node.inner_html.strip)
10
- move_down 2
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
@@ -5,9 +5,12 @@ module Bookify::Node
5
5
  def render
6
6
  move_down 5
7
7
  break_if_close_to_bottom
8
- font :h4
9
- text decode_html(node.inner_html.strip)
10
- move_down 2
8
+
9
+ font :h4 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
@@ -5,19 +5,20 @@ module Bookify::Node
5
5
  def render
6
6
  font :primary
7
7
 
8
- table table_data, header: true, width: bounds.width do
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 = [:top, :bottom]
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
- row(-1).borders = [:bottom]
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bookify
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.0
4
+ version: 2.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joey Schoblaska