prawn-table-html 0.0.1 → 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: '078e99259e55bc4de98bee9204fa640c4f4aca11964d127d479885938f107ec6'
4
- data.tar.gz: 06506e5d430f2260b1ecae80d1862d9bd63f0f63f9624dc2b2672b9d6693c7cf
3
+ metadata.gz: 155d2dcb70b6b5978c8c25680bc815b508517dfbe8bdc62d75d2831f9b8c34ee
4
+ data.tar.gz: ee91eb4a9c361cc67a01f6b180a36261bdb45ddd7caa371738a2602ae6d95e3c
5
5
  SHA512:
6
- metadata.gz: 1e9f3cc44c133268464ffc98299cd90d9472e1ca5db40ac2b8ea1e3cbc16702c0844220d76de920fe0e39d3dbe97ed42bc2027ca761e0422443044769160f7ce
7
- data.tar.gz: ebcede030ba385ce31804769d1286345c6116336cd4fb193c5b89227a1162d7c7b4905ba6f52385cbed696b0644235bc11883f5c5465b60cbb42ef332d8ca83b
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.1
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mattia Roccoberton
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2025-01-08 00:00:00.000000000 Z
13
+ date: 2025-01-09 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: oga
@@ -62,7 +62,7 @@ extra_rdoc_files: []
62
62
  files:
63
63
  - LICENSE.txt
64
64
  - README.md
65
- - lib/prawn-html.rb
65
+ - lib/prawn-table-html.rb
66
66
  - lib/prawn_html/attributes.rb
67
67
  - lib/prawn_html/callbacks/background.rb
68
68
  - lib/prawn_html/callbacks/strike_through.rb
File without changes