asciidoctor-pdf 1.5.3 → 1.6.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.adoc +70 -1
  3. data/{LICENSE.adoc → LICENSE} +3 -4
  4. data/NOTICE.adoc +4 -6
  5. data/README.adoc +139 -46
  6. data/asciidoctor-pdf.gemspec +11 -14
  7. data/bin/asciidoctor-pdf-optimize +1 -1
  8. data/docs/theming-guide.adoc +34 -28
  9. data/lib/asciidoctor/pdf/converter.rb +87 -77
  10. data/lib/asciidoctor/pdf/ext/asciidoctor/section.rb +3 -2
  11. data/lib/asciidoctor/pdf/ext/core/file.rb +4 -5
  12. data/lib/asciidoctor/pdf/ext/core.rb +0 -1
  13. data/lib/asciidoctor/pdf/ext/pdf-core/pdf_object.rb +1 -1
  14. data/lib/asciidoctor/pdf/ext/pdf-core.rb +17 -0
  15. data/lib/asciidoctor/pdf/ext/prawn/coderay_encoder.rb +4 -13
  16. data/lib/asciidoctor/pdf/ext/prawn/extensions.rb +28 -2
  17. data/lib/asciidoctor/pdf/ext/prawn/font_metric_cache.rb +1 -1
  18. data/lib/asciidoctor/pdf/ext/prawn/formatted_text/arranger.rb +15 -0
  19. data/lib/asciidoctor/pdf/ext/prawn-svg.rb +0 -1
  20. data/lib/asciidoctor/pdf/ext/prawn.rb +1 -0
  21. data/lib/asciidoctor/pdf/ext/pygments.rb +11 -9
  22. data/lib/asciidoctor/pdf/ext.rb +0 -1
  23. data/lib/asciidoctor/pdf/formatted_text/fragment_position_renderer.rb +5 -1
  24. data/lib/asciidoctor/pdf/formatted_text/inline_image_arranger.rb +8 -1
  25. data/lib/asciidoctor/pdf/formatted_text/transform.rb +6 -4
  26. data/lib/asciidoctor/pdf/index_catalog.rb +1 -1
  27. data/lib/asciidoctor/pdf/optimizer.rb +40 -12
  28. data/lib/asciidoctor/pdf/pdfmark.rb +1 -2
  29. data/lib/asciidoctor/pdf/text_transformer.rb +10 -73
  30. data/lib/asciidoctor/pdf/theme_loader.rb +1 -1
  31. data/lib/asciidoctor/pdf/version.rb +1 -1
  32. data/lib/asciidoctor/pdf.rb +3 -0
  33. metadata +21 -63
  34. data/lib/asciidoctor/pdf/ext/core/numeric.rb +0 -26
  35. data/lib/asciidoctor/pdf/ext/prawn-svg/interface.rb +0 -14
  36. data/lib/asciidoctor/pdf/ext/prawn-templates.rb +0 -7
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asciidoctor-pdf
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.3
4
+ version: 1.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan Allen
@@ -9,62 +9,36 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-02-28 00:00:00.000000000 Z
12
+ date: 2021-12-31 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: asciidoctor
16
- requirement: !ruby/object:Gem::Requirement
17
- requirements:
18
- - - ">="
19
- - !ruby/object:Gem::Version
20
- version: 1.5.3
21
- - - "<"
22
- - !ruby/object:Gem::Version
23
- version: 3.0.0
24
- type: :runtime
25
- prerelease: false
26
- version_requirements: !ruby/object:Gem::Requirement
27
- requirements:
28
- - - ">="
29
- - !ruby/object:Gem::Version
30
- version: 1.5.3
31
- - - "<"
32
- - !ruby/object:Gem::Version
33
- version: 3.0.0
34
- - !ruby/object:Gem::Dependency
35
- name: prawn
36
16
  requirement: !ruby/object:Gem::Requirement
37
17
  requirements:
38
18
  - - "~>"
39
19
  - !ruby/object:Gem::Version
40
- version: 2.2.0
20
+ version: '2.0'
41
21
  type: :runtime
42
22
  prerelease: false
43
23
  version_requirements: !ruby/object:Gem::Requirement
44
24
  requirements:
45
25
  - - "~>"
46
26
  - !ruby/object:Gem::Version
47
- version: 2.2.0
27
+ version: '2.0'
48
28
  - !ruby/object:Gem::Dependency
49
- name: ttfunk
29
+ name: prawn
50
30
  requirement: !ruby/object:Gem::Requirement
51
31
  requirements:
52
32
  - - "~>"
53
33
  - !ruby/object:Gem::Version
54
- version: 1.5.0
55
- - - ">="
56
- - !ruby/object:Gem::Version
57
- version: 1.5.1
34
+ version: 2.4.0
58
35
  type: :runtime
59
36
  prerelease: false
60
37
  version_requirements: !ruby/object:Gem::Requirement
61
38
  requirements:
62
39
  - - "~>"
63
40
  - !ruby/object:Gem::Version
64
- version: 1.5.0
65
- - - ">="
66
- - !ruby/object:Gem::Version
67
- version: 1.5.1
41
+ version: 2.4.0
68
42
  - !ruby/object:Gem::Dependency
69
43
  name: prawn-table
70
44
  requirement: !ruby/object:Gem::Requirement
@@ -99,28 +73,28 @@ dependencies:
99
73
  requirements:
100
74
  - - "~>"
101
75
  - !ruby/object:Gem::Version
102
- version: 0.30.0
76
+ version: 0.32.0
103
77
  type: :runtime
104
78
  prerelease: false
105
79
  version_requirements: !ruby/object:Gem::Requirement
106
80
  requirements:
107
81
  - - "~>"
108
82
  - !ruby/object:Gem::Version
109
- version: 0.30.0
83
+ version: 0.32.0
110
84
  - !ruby/object:Gem::Dependency
111
85
  name: prawn-icon
112
86
  requirement: !ruby/object:Gem::Requirement
113
87
  requirements:
114
88
  - - "~>"
115
89
  - !ruby/object:Gem::Version
116
- version: 2.5.0
90
+ version: 3.0.0
117
91
  type: :runtime
118
92
  prerelease: false
119
93
  version_requirements: !ruby/object:Gem::Requirement
120
94
  requirements:
121
95
  - - "~>"
122
96
  - !ruby/object:Gem::Version
123
- version: 2.5.0
97
+ version: 3.0.0
124
98
  - !ruby/object:Gem::Dependency
125
99
  name: safe_yaml
126
100
  requirement: !ruby/object:Gem::Requirement
@@ -135,34 +109,20 @@ dependencies:
135
109
  - - "~>"
136
110
  - !ruby/object:Gem::Version
137
111
  version: 1.0.0
138
- - !ruby/object:Gem::Dependency
139
- name: thread_safe
140
- requirement: !ruby/object:Gem::Requirement
141
- requirements:
142
- - - "~>"
143
- - !ruby/object:Gem::Version
144
- version: 0.3.0
145
- type: :runtime
146
- prerelease: false
147
- version_requirements: !ruby/object:Gem::Requirement
148
- requirements:
149
- - - "~>"
150
- - !ruby/object:Gem::Version
151
- version: 0.3.0
152
112
  - !ruby/object:Gem::Dependency
153
113
  name: concurrent-ruby
154
114
  requirement: !ruby/object:Gem::Requirement
155
115
  requirements:
156
116
  - - "~>"
157
117
  - !ruby/object:Gem::Version
158
- version: 1.1.0
118
+ version: '1.1'
159
119
  type: :runtime
160
120
  prerelease: false
161
121
  version_requirements: !ruby/object:Gem::Requirement
162
122
  requirements:
163
123
  - - "~>"
164
124
  - !ruby/object:Gem::Version
165
- version: 1.1.0
125
+ version: '1.1'
166
126
  - !ruby/object:Gem::Dependency
167
127
  name: treetop
168
128
  requirement: !ruby/object:Gem::Requirement
@@ -197,14 +157,14 @@ dependencies:
197
157
  requirements:
198
158
  - - "~>"
199
159
  - !ruby/object:Gem::Version
200
- version: 3.9.0
160
+ version: 3.10.0
201
161
  type: :development
202
162
  prerelease: false
203
163
  version_requirements: !ruby/object:Gem::Requirement
204
164
  requirements:
205
165
  - - "~>"
206
166
  - !ruby/object:Gem::Version
207
- version: 3.9.0
167
+ version: 3.10.0
208
168
  - !ruby/object:Gem::Dependency
209
169
  name: pdf-inspector
210
170
  requirement: !ruby/object:Gem::Requirement
@@ -253,14 +213,14 @@ dependencies:
253
213
  requirements:
254
214
  - - "~>"
255
215
  - !ruby/object:Gem::Version
256
- version: 1.3.0
216
+ version: 1.4.0
257
217
  type: :development
258
218
  prerelease: false
259
219
  version_requirements: !ruby/object:Gem::Requirement
260
220
  requirements:
261
221
  - - "~>"
262
222
  - !ruby/object:Gem::Version
263
- version: 1.3.0
223
+ version: 1.4.0
264
224
  description: An extension for Asciidoctor that converts AsciiDoc documents to PDF
265
225
  using the Prawn PDF library.
266
226
  email: dan@opendevise.com
@@ -272,7 +232,7 @@ extra_rdoc_files: []
272
232
  files:
273
233
  - ".yardopts"
274
234
  - CHANGELOG.adoc
275
- - LICENSE.adoc
235
+ - LICENSE
276
236
  - NOTICE.adoc
277
237
  - README.adoc
278
238
  - asciidoctor-pdf.gemspec
@@ -321,7 +281,6 @@ files:
321
281
  - lib/asciidoctor/pdf/ext/core/array.rb
322
282
  - lib/asciidoctor/pdf/ext/core/file.rb
323
283
  - lib/asciidoctor/pdf/ext/core/hash.rb
324
- - lib/asciidoctor/pdf/ext/core/numeric.rb
325
284
  - lib/asciidoctor/pdf/ext/core/object.rb
326
285
  - lib/asciidoctor/pdf/ext/core/quantifiable_stdout.rb
327
286
  - lib/asciidoctor/pdf/ext/core/regexp.rb
@@ -330,17 +289,16 @@ files:
330
289
  - lib/asciidoctor/pdf/ext/pdf-core/page.rb
331
290
  - lib/asciidoctor/pdf/ext/pdf-core/pdf_object.rb
332
291
  - lib/asciidoctor/pdf/ext/prawn-svg.rb
333
- - lib/asciidoctor/pdf/ext/prawn-svg/interface.rb
334
292
  - lib/asciidoctor/pdf/ext/prawn-table.rb
335
293
  - lib/asciidoctor/pdf/ext/prawn-table/cell.rb
336
294
  - lib/asciidoctor/pdf/ext/prawn-table/cell/asciidoc.rb
337
295
  - lib/asciidoctor/pdf/ext/prawn-table/cell/text.rb
338
- - lib/asciidoctor/pdf/ext/prawn-templates.rb
339
296
  - lib/asciidoctor/pdf/ext/prawn.rb
340
297
  - lib/asciidoctor/pdf/ext/prawn/coderay_encoder.rb
341
298
  - lib/asciidoctor/pdf/ext/prawn/extensions.rb
342
299
  - lib/asciidoctor/pdf/ext/prawn/font/afm.rb
343
300
  - lib/asciidoctor/pdf/ext/prawn/font_metric_cache.rb
301
+ - lib/asciidoctor/pdf/ext/prawn/formatted_text/arranger.rb
344
302
  - lib/asciidoctor/pdf/ext/prawn/formatted_text/box.rb
345
303
  - lib/asciidoctor/pdf/ext/prawn/formatted_text/fragment.rb
346
304
  - lib/asciidoctor/pdf/ext/prawn/images.rb
@@ -374,7 +332,7 @@ licenses:
374
332
  - MIT
375
333
  metadata:
376
334
  bug_tracker_uri: https://github.com/asciidoctor/asciidoctor-pdf/issues
377
- changelog_uri: https://github.com/asciidoctor/asciidoctor-pdf/blob/master/CHANGELOG.adoc
335
+ changelog_uri: https://github.com/asciidoctor/asciidoctor-pdf/blob/main/CHANGELOG.adoc
378
336
  mailing_list_uri: http://discuss.asciidoctor.org
379
337
  source_code_uri: https://github.com/asciidoctor/asciidoctor-pdf
380
338
  post_install_message:
@@ -392,7 +350,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
392
350
  - !ruby/object:Gem::Version
393
351
  version: '0'
394
352
  requirements: []
395
- rubygems_version: 3.0.6
353
+ rubygems_version: 3.2.32
396
354
  signing_key:
397
355
  specification_version: 4
398
356
  summary: Converts AsciiDoc documents to PDF using Asciidoctor and Prawn
@@ -1,26 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # NOTE remove once minimum required Ruby version is at least 2.4
4
- Float.prepend (Module.new do
5
- def truncate *args
6
- if args.length == 1
7
- if (precision = Integer args.shift) == 0
8
- super
9
- elsif precision > 0
10
- precision_factor = 10.0**precision
11
- (self * precision_factor).to_i / precision_factor
12
- else
13
- precision_factor = 10**precision.abs
14
- (self / precision_factor).to_i * precision_factor
15
- end
16
- else
17
- super
18
- end
19
- end
20
- end) if (Float.instance_method :truncate).arity == 0
21
-
22
- Integer.prepend (Module.new do
23
- def truncate *_args
24
- super()
25
- end
26
- end) if (Integer.instance_method :truncate).arity == 0
@@ -1,14 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Prawn
4
- module SVG
5
- class Interface
6
- def resize opts = {}
7
- sizing = document.sizing
8
- sizing.requested_width = opts[:width]
9
- sizing.requested_height = opts[:height]
10
- sizing.calculate
11
- end
12
- end
13
- end
14
- end unless Prawn::SVG::Interface.method_defined? :resize
@@ -1,7 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- class Prawn::Document
4
- # NOTE allows prawn-templates 0.0.4 to be used with prawn >= 2.2.0
5
- const_set :VALID_OPTIONS, (send :remove_const, :VALID_OPTIONS).dup if VALID_OPTIONS.frozen?
6
- end
7
- require 'prawn/templates'