prawn-table-html 0.0.2 → 0.0.3

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
  SHA256:
3
- metadata.gz: 9ef3a6c9e2765f260b89f4f714512338b5cd577330d31640c23af6de484d07ea
4
- data.tar.gz: 897d4bfd75697ef19cb96dc2eaef8acb24380e99ace39658d5340d19e1512914
3
+ metadata.gz: 155d2dcb70b6b5978c8c25680bc815b508517dfbe8bdc62d75d2831f9b8c34ee
4
+ data.tar.gz: ee91eb4a9c361cc67a01f6b180a36261bdb45ddd7caa371738a2602ae6d95e3c
5
5
  SHA512:
6
- metadata.gz: dff752b45b0e44e6972077647757dd0d484a86b2e9c92d7d2825e79a3303f5214175a07164ab4187bc3da13abfead75dc9b26584038abe3e835a51df43e56c88
7
- data.tar.gz: 46ad02f279adc6334b3d14109e5d3f2cae0908bcfe62b6cee5543112682fda746929351cccb6aced7fd7d0111d38bd911e138c18f964a215dcd5172d63a96470
6
+ metadata.gz: '097899c2e896ea1c23ee68b50cbfb5d63a58b92d7518ef17b7b756c6b29d85c72f96020a38dd8f5a53581027a71d5712d4a4f8f31fd002a06f1d5e0cd1db0df3'
7
+ data.tar.gz: 3ab0b2fa8b820b4e30c1b21488b45a0b2a9b9b5585bdd3dc0b2489ca790d1334aa04a54a800bc4ca49f9990b68313866e8747d02cba36f58c6c34615f6e5bb6f
@@ -102,7 +102,6 @@ module PrawnHtml
102
102
  def apply_tag_close_styles(element)
103
103
  tag_styles = element.tag_close_styles
104
104
  @last_margin = tag_styles[:margin_bottom].to_f
105
- puts "apply_tag_close_styles(#{element.tag}), margin_bottom=#{tag_styles[:margin_bottom]}, last_margin=#{@last_margin}"
106
105
  pdf.advance_cursor(last_margin + tag_styles[:padding_bottom].to_f)
107
106
  pdf.start_new_page if tag_styles[:break_after]
108
107
  end
@@ -110,7 +109,6 @@ module PrawnHtml
110
109
  def apply_tag_open_styles(element)
111
110
  tag_styles = element.tag_open_styles
112
111
  move_down = (tag_styles[:margin_top].to_f - last_margin) + tag_styles[:padding_top].to_f
113
- puts "apply_tag_open_styles(#{element.tag}), margin_top=#{tag_styles[:margin_top]}, padding_top: #{tag_styles[:padding_top]} last_margin=#{@last_margin}"
114
112
  pdf.advance_cursor(move_down) if move_down > 0
115
113
  pdf.start_new_page if tag_styles[:break_before]
116
114
  end
@@ -4,9 +4,11 @@ module PrawnHtml
4
4
  module Tags
5
5
  class Mark < Tag
6
6
  ELEMENTS = [:mark].freeze
7
+ DEFAULT_COLOR = "#ff0"
7
8
 
8
9
  def tag_styles
9
- 'background: #ff0'
10
+ color = attrs["data-color"].blank? ? DEFAULT_COLOR : attrs["data-color"]
11
+ "background: #{color}"
10
12
  end
11
13
  end
12
14
  end
@@ -7,7 +7,6 @@ module PrawnHtml
7
7
 
8
8
  def block?
9
9
  true
10
- puts "TABLE: I am a block, watch out for margin"
11
10
  end
12
11
 
13
12
  def custom_render(pdf, _context)
@@ -34,7 +33,6 @@ module PrawnHtml
34
33
  inline_format: true
35
34
  }
36
35
 
37
- # @pdf_wrapper.pdf.move_up(100)
38
36
  if @col_widths.any?
39
37
  @pdf_wrapper.table(@rows, column_widths: @col_widths, cell_style: cell_style)
40
38
  else
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: prawn-table-html
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mattia Roccoberton