asciidoctor-pdf 2.3.13 → 2.3.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.adoc +38 -1
- data/README.adoc +1 -1
- data/asciidoctor-pdf.gemspec +2 -1
- data/lib/asciidoctor/pdf/converter.rb +9 -8
- data/lib/asciidoctor/pdf/ext/asciidoctor/image.rb +3 -2
- data/lib/asciidoctor/pdf/ext/prawn-svg/elements/use.rb +12 -0
- data/lib/asciidoctor/pdf/ext/prawn-svg.rb +1 -0
- data/lib/asciidoctor/pdf/version.rb +1 -1
- data/lib/asciidoctor/pdf.rb +6 -0
- metadata +20 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4b65e5da741e3df4c56f2e6ee79a9500dbd28a7c3f27d1ffea9c66bbb4d7031d
|
4
|
+
data.tar.gz: 41020f7cff7695528dac65d0d6368b4688f1fc00895a6ed68c9bf0d1c34ab594
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cd72a63d48e8f29937bc6613257924d169fa3e878e3b5ab23a846fdc3fcccc1ee2471f800c380deee22b14b624b9db2383b8e00de62d21408467e3a3c77047b8
|
7
|
+
data.tar.gz: ada67363d0d5a5e551a4f9b499d31ce273d831e9de6c3c259130739c5b006f06937315f3130d25b89cf32a4b332deb3da23487cca9b856fd6753e24d2a4e027b
|
data/CHANGELOG.adoc
CHANGED
@@ -5,14 +5,51 @@
|
|
5
5
|
This document provides a high-level view of the changes to the {project-name} by release.
|
6
6
|
For a detailed view of what has changed, refer to the {url-repo}/commits/main[commit history] on GitHub.
|
7
7
|
|
8
|
+
== 2.3.15 (2024-03-12) - @mojavelinux
|
9
|
+
|
10
|
+
Improvements::
|
11
|
+
|
12
|
+
* drop links from entries in TOC (#2505)
|
13
|
+
|
14
|
+
Compliance::
|
15
|
+
|
16
|
+
* lock ttfunk to 1.7.x to avoid requiring Ruby headers (i.e., development libraries) to install gem (#2508)
|
17
|
+
|
18
|
+
=== Details
|
19
|
+
|
20
|
+
{url-repo}/releases/tag/v2.3.15[git tag] | {url-repo}/compare/v2.3.14\...v2.3.15[full diff]
|
21
|
+
|
22
|
+
== 2.3.14 (2024-03-08) - @mojavelinux
|
23
|
+
|
24
|
+
Improvements::
|
25
|
+
|
26
|
+
* upgrade prawn-svg to 0.34 to add support for SVG referenced by image tag (SVG in SVG)
|
27
|
+
|
28
|
+
Bug Fixes::
|
29
|
+
|
30
|
+
* propagate source location to table cell for description in horizontal dlist so it is included in truncation warning message (#2502)
|
31
|
+
* eradicate use of the base64 library to fix warning about base64 gem when using Ruby >= 3.3
|
32
|
+
* upgrade prawn-svg to 0.34 to fix warning about base64 gem when using Ruby >= 3.3; apply additional patch to fix bug in prawn-svg
|
33
|
+
|
34
|
+
Build / Infrastructure::
|
35
|
+
|
36
|
+
* bump upper Ruby version to 3.3 in CI workflow
|
37
|
+
|
38
|
+
=== Details
|
39
|
+
|
40
|
+
{url-repo}/releases/tag/v2.3.14[git tag] | {url-repo}/compare/v2.3.13\...v2.3.14[full diff]
|
41
|
+
|
8
42
|
== 2.3.13 (2024-02-16) - @mojavelinux
|
9
43
|
|
44
|
+
Improvements::
|
45
|
+
|
46
|
+
* support toc start at value for page numbering and running content when toc is added using macro (#2489)
|
47
|
+
|
10
48
|
Bug Fixes::
|
11
49
|
|
12
50
|
* don't drop text on line above inline image macro in running content value (#2495)
|
13
51
|
* when looking for a value that only contains an image macro, match the whole string instead of per line (#2495)
|
14
52
|
* don't warn about missing character in fallback font when inline image is advanced to next page (#2492)
|
15
|
-
* support toc start at value for page numbering and running content when toc is added using macro (#2489)
|
16
53
|
* fix page number of index entries in prepress book when page numbering starts at toc or after toc and toc is inserted using macro (#2487)
|
17
54
|
|
18
55
|
=== Details
|
data/README.adoc
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
= Asciidoctor PDF: A native PDF converter for AsciiDoc
|
2
2
|
Dan Allen <https://github.com/mojavelinux[@mojavelinux]>; Sarah White <https://github.com/graphitefriction[@graphitefriction]>
|
3
|
-
v2.3.
|
3
|
+
v2.3.15, 2024-03-12
|
4
4
|
// Settings:
|
5
5
|
:experimental:
|
6
6
|
:idprefix:
|
data/asciidoctor-pdf.gemspec
CHANGED
@@ -35,10 +35,11 @@ Gem::Specification.new do |s|
|
|
35
35
|
|
36
36
|
s.add_runtime_dependency 'asciidoctor', '~> 2.0'
|
37
37
|
s.add_runtime_dependency 'prawn', '~> 2.4.0'
|
38
|
+
s.add_runtime_dependency 'ttfunk', '~> 1.7.0' # pin ttfunk for compatiblity; prawn gem only pins it to major version
|
38
39
|
s.add_runtime_dependency 'matrix', '~> 0.4' # required until prawn >= 2.5.0 is released
|
39
40
|
s.add_runtime_dependency 'prawn-table', '~> 0.2.0'
|
40
41
|
s.add_runtime_dependency 'prawn-templates', '~> 0.1.0'
|
41
|
-
s.add_runtime_dependency 'prawn-svg', '~> 0.
|
42
|
+
s.add_runtime_dependency 'prawn-svg', '~> 0.34.0'
|
42
43
|
s.add_runtime_dependency 'prawn-icon', '~> 3.0.0'
|
43
44
|
s.add_runtime_dependency 'concurrent-ruby', '~> 1.1'
|
44
45
|
s.add_runtime_dependency 'treetop', '~> 1.6.0'
|
@@ -1458,7 +1458,7 @@ module Asciidoctor
|
|
1458
1458
|
desc_container = Block.new node, :open
|
1459
1459
|
desc_container << (Block.new desc_container, :paragraph, source: (desc.instance_variable_get :@text), subs: :default) if desc.text?
|
1460
1460
|
desc.blocks.each {|b| desc_container << b.dup } if desc.blocks?
|
1461
|
-
row_data << { content: (::Prawn::Table::Cell::AsciiDoc.new self, content: (item[1] = desc_container), text_color: @font_color, padding: desc_padding, valign: :top) }
|
1461
|
+
row_data << { content: (::Prawn::Table::Cell::AsciiDoc.new self, content: (item[1] = desc_container), text_color: @font_color, padding: desc_padding, valign: :top, source_location: desc.source_location) }
|
1462
1462
|
else
|
1463
1463
|
row_data << {}
|
1464
1464
|
end
|
@@ -1721,7 +1721,7 @@ module Asciidoctor
|
|
1721
1721
|
if image_format == 'gif' && !(defined? ::GMagick::Image)
|
1722
1722
|
log :warn, %(GIF image format not supported. Install the prawn-gmagick gem or convert #{target} to PNG.)
|
1723
1723
|
image_path = nil
|
1724
|
-
elsif ::
|
1724
|
+
elsif ::Asciidoctor::Image::Base64Encoded === target
|
1725
1725
|
image_path = target
|
1726
1726
|
elsif (image_path = resolve_image_path node, target, image_format, (opts.fetch :relative_to_imagesdir, true))
|
1727
1727
|
if image_format == 'pdf'
|
@@ -1790,8 +1790,8 @@ module Asciidoctor
|
|
1790
1790
|
rendered_h = rendered_w = nil
|
1791
1791
|
span_page_width_if align_to_page do
|
1792
1792
|
if image_format == 'svg'
|
1793
|
-
if ::
|
1794
|
-
svg_data =
|
1793
|
+
if ::Asciidoctor::Image::Base64Encoded === image_path
|
1794
|
+
svg_data = image_path.unpack1 'm'
|
1795
1795
|
file_request_root = false
|
1796
1796
|
else
|
1797
1797
|
svg_data = ::File.read image_path, mode: 'r:UTF-8'
|
@@ -1842,8 +1842,8 @@ module Asciidoctor
|
|
1842
1842
|
else
|
1843
1843
|
# FIXME: this code really needs to be better organized!
|
1844
1844
|
# NOTE: use low-level API to access intrinsic dimensions; build_image_object caches image data previously loaded
|
1845
|
-
image_obj, image_info = ::
|
1846
|
-
::StringIO.open((
|
1845
|
+
image_obj, image_info = ::Asciidoctor::Image::Base64Encoded === image_path ?
|
1846
|
+
::StringIO.open((image_path.unpack1 'm'), 'rb') {|fd| build_image_object fd } :
|
1847
1847
|
::File.open(image_path, 'rb') {|fd| build_image_object fd }
|
1848
1848
|
actual_w = to_pt image_info.width, :px
|
1849
1849
|
width = actual_w * scale if scale
|
@@ -3917,6 +3917,7 @@ module Asciidoctor
|
|
3917
3917
|
theme_font :toc, level: entry_level do
|
3918
3918
|
entry_title = entry.context == :section ? entry.numbered_title : (entry.title? ? entry.title : (entry.xreftext 'basic'))
|
3919
3919
|
next if entry_title.empty?
|
3920
|
+
entry_title = entry_title.gsub DropAnchorRx, '' if entry_title.include? '<a'
|
3920
3921
|
entry_title = transform_text entry_title, @text_transform if @text_transform
|
3921
3922
|
pgnum_label_placeholder_width = rendered_width_of_string '0' * @toc_max_pagenum_digits
|
3922
3923
|
# NOTE: only write title (excluding dots and page number) if this is a dry run
|
@@ -4313,11 +4314,11 @@ module Asciidoctor
|
|
4313
4314
|
end
|
4314
4315
|
@tmp_files ||= {}
|
4315
4316
|
# NOTE: base64 logic currently used for inline images
|
4316
|
-
if ::
|
4317
|
+
if ::Asciidoctor::Image::Base64Encoded === image_path
|
4317
4318
|
return @tmp_files[image_path] if @tmp_files.key? image_path
|
4318
4319
|
tmp_image = ::Tempfile.create %W(image- .#{image_format})
|
4319
4320
|
tmp_image.binmode unless image_format == 'svg'
|
4320
|
-
tmp_image.write
|
4321
|
+
tmp_image.write image_path.unpack1 'm'
|
4321
4322
|
tmp_image.close
|
4322
4323
|
@tmp_files[image_path] = tmp_image.path
|
4323
4324
|
# NOTE: this will catch a classloader resource path on JRuby (e.g., uri:classloader:/path/to/image)
|
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
module Asciidoctor
|
4
4
|
module Image
|
5
|
+
Base64Encoded = ::Module.new
|
5
6
|
DataUriRx = %r(^data:image/(?<fmt>png|jpe?g|gif|pdf|bmp|tiff|svg\+xml);base64,(?<data>.*)$)
|
6
7
|
FormatAliases = { 'jpg' => 'jpeg', 'svg+xml' => 'svg' }
|
7
8
|
|
@@ -11,7 +12,7 @@ module Asciidoctor
|
|
11
12
|
|
12
13
|
def self.target_and_format image_path, attributes = nil
|
13
14
|
if (image_path.start_with? 'data:') && (m = DataUriRx.match image_path)
|
14
|
-
[(m[:data].extend
|
15
|
+
[(m[:data].extend Base64Encoded), (FormatAliases.fetch m[:fmt], m[:fmt])]
|
15
16
|
else
|
16
17
|
[image_path, attributes&.[]('format') || ((ext = ::File.extname image_path).downcase.slice 1, ext.length)]
|
17
18
|
end
|
@@ -20,7 +21,7 @@ module Asciidoctor
|
|
20
21
|
def target_and_format
|
21
22
|
image_path = inline? ? target : (attr 'target')
|
22
23
|
if (image_path.start_with? 'data:') && (m = DataUriRx.match image_path)
|
23
|
-
[(m[:data].extend
|
24
|
+
[(m[:data].extend Base64Encoded), (FormatAliases.fetch m[:fmt], m[:fmt])]
|
24
25
|
else
|
25
26
|
[image_path, (attr 'format', nil, false) || ((ext = ::File.extname image_path).downcase.slice 1, ext.length)]
|
26
27
|
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# see https://github.com/mogest/prawn-svg/issues/164
|
4
|
+
Prawn::SVG::Elements::Use.prepend (Module.new do
|
5
|
+
def parse
|
6
|
+
result = super
|
7
|
+
if @referenced_element_source.name == 'symbol' && !(@referenced_element_source.attributes.key? 'viewBox')
|
8
|
+
@referenced_element_class = Prawn::SVG::Elements::Container
|
9
|
+
end
|
10
|
+
result
|
11
|
+
end
|
12
|
+
end)
|
@@ -3,6 +3,7 @@
|
|
3
3
|
require 'prawn-svg'
|
4
4
|
require_relative 'prawn-svg/calculators/document_sizing'
|
5
5
|
require_relative 'prawn-svg/elements/image'
|
6
|
+
require_relative 'prawn-svg/elements/use'
|
6
7
|
require_relative 'prawn-svg/loaders/data'
|
7
8
|
require_relative 'prawn-svg/loaders/file'
|
8
9
|
require_relative 'prawn-svg/loaders/web'
|
data/lib/asciidoctor/pdf.rb
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
proc do
|
4
|
+
old_verbose, $VERBOSE = $VERBOSE, nil
|
5
|
+
require 'bigdecimal' # eagerly require bigdecimal without warnings to avoid warning caused by ttfunk 1.7.0
|
6
|
+
$VERBOSE = old_verbose
|
7
|
+
end.call
|
8
|
+
|
3
9
|
autoload :Set, 'set'
|
4
10
|
autoload :StringIO, 'stringio'
|
5
11
|
autoload :Tempfile, 'tempfile'
|
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: 2.3.
|
4
|
+
version: 2.3.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dan Allen
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2024-
|
12
|
+
date: 2024-03-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: asciidoctor
|
@@ -39,6 +39,20 @@ dependencies:
|
|
39
39
|
- - "~>"
|
40
40
|
- !ruby/object:Gem::Version
|
41
41
|
version: 2.4.0
|
42
|
+
- !ruby/object:Gem::Dependency
|
43
|
+
name: ttfunk
|
44
|
+
requirement: !ruby/object:Gem::Requirement
|
45
|
+
requirements:
|
46
|
+
- - "~>"
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: 1.7.0
|
49
|
+
type: :runtime
|
50
|
+
prerelease: false
|
51
|
+
version_requirements: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - "~>"
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: 1.7.0
|
42
56
|
- !ruby/object:Gem::Dependency
|
43
57
|
name: matrix
|
44
58
|
requirement: !ruby/object:Gem::Requirement
|
@@ -87,14 +101,14 @@ dependencies:
|
|
87
101
|
requirements:
|
88
102
|
- - "~>"
|
89
103
|
- !ruby/object:Gem::Version
|
90
|
-
version: 0.
|
104
|
+
version: 0.34.0
|
91
105
|
type: :runtime
|
92
106
|
prerelease: false
|
93
107
|
version_requirements: !ruby/object:Gem::Requirement
|
94
108
|
requirements:
|
95
109
|
- - "~>"
|
96
110
|
- !ruby/object:Gem::Version
|
97
|
-
version: 0.
|
111
|
+
version: 0.34.0
|
98
112
|
- !ruby/object:Gem::Dependency
|
99
113
|
name: prawn-icon
|
100
114
|
requirement: !ruby/object:Gem::Requirement
|
@@ -262,6 +276,7 @@ files:
|
|
262
276
|
- lib/asciidoctor/pdf/ext/prawn-svg.rb
|
263
277
|
- lib/asciidoctor/pdf/ext/prawn-svg/calculators/document_sizing.rb
|
264
278
|
- lib/asciidoctor/pdf/ext/prawn-svg/elements/image.rb
|
279
|
+
- lib/asciidoctor/pdf/ext/prawn-svg/elements/use.rb
|
265
280
|
- lib/asciidoctor/pdf/ext/prawn-svg/loaders/data.rb
|
266
281
|
- lib/asciidoctor/pdf/ext/prawn-svg/loaders/file.rb
|
267
282
|
- lib/asciidoctor/pdf/ext/prawn-svg/loaders/web.rb
|
@@ -335,7 +350,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
335
350
|
- !ruby/object:Gem::Version
|
336
351
|
version: '0'
|
337
352
|
requirements: []
|
338
|
-
rubygems_version: 3.3
|
353
|
+
rubygems_version: 3.5.3
|
339
354
|
signing_key:
|
340
355
|
specification_version: 4
|
341
356
|
summary: Converts AsciiDoc documents to PDF using Asciidoctor and Prawn
|