asciidoctor-pdf 2.3.3 → 2.3.5

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: 1581f65b075da9ee0793840f953f5c2562af23e5252d8c459d661bf3b59ad675
4
- data.tar.gz: fab056a2621eed2b40f7ed3ebcfc96f3601beb2ce3634118bf9e12272874e184
3
+ metadata.gz: 184bc10cddae48122341892c25f9d8cecdb3beeb85497e29a5171eae78185837
4
+ data.tar.gz: 3928a499726157b753b6d7a8241ccd7f5bfcd271c3bd671d691d608b58c04b54
5
5
  SHA512:
6
- metadata.gz: d4f89a9ba025c7ca1c4563e98b6e64167ae8822c920f0f5a2e1204ea4c6cc79b1e3f5680adbc79977e9ee193435523bdc61e5be465f2dcd55f2f151c98de0680
7
- data.tar.gz: 5cdd5a6d92cd55d70d279cd0c42cf66afe436f8f76c4facd0747964921b0f29cfa8c6012998f4e842ddcfe87a5eed4838819a98d9303aeb0717fc012b7ff0b9f
6
+ metadata.gz: e3fa4c82f148cbe554b117fad1b86330658948ad2f1ec18de0b6e7d82304bdcf7999c57a45a6d0d4e3f71d1a6a0cb4e95931788abd9d8aba95652100c20e888e
7
+ data.tar.gz: 394395230c7c484ae2c3b214cf50f9d2e635897c25dbad3032a1d1c7f270a449ba3b096c901891cc109835273ac7f705940a6a8deedbcff00bbb2cdc2bb5bf17
data/CHANGELOG.adoc CHANGED
@@ -5,6 +5,35 @@
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.5 (2023-03-31) - @mojavelinux
9
+
10
+ Enhancements::
11
+
12
+ * add `callout-list-marker-font-color` theme key to control color of conum marker in callout list (#2402)
13
+
14
+ Bug Fixes::
15
+
16
+ * catalog all footnotes found inside AsciiDoc table cells and render them in the footnotes list (#2410)
17
+ * do not drop section that follows empty index (#2368)
18
+ * restore bottom margin on table with `breakable` or `unbreakable` option (#2379)
19
+ * honor theme settings for caption on table with `breakable` or `unbreakable` option (#2379)
20
+ * use first recto page after toc when media is prepress and page numbering or running content start-at value is `after-toc` (#2398)
21
+
22
+ === Details
23
+
24
+ {url-repo}/releases/tag/v2.3.5[git tag] | {url-repo}/compare/v2.3.4\...v2.3.5[full diff]
25
+
26
+ == 2.3.4 (2022-10-29) - @mojavelinux
27
+
28
+ Bug Fixes::
29
+
30
+ * resolve attribute references in target of image in running content (#2361)
31
+ * replace use of AbstractNode#role= method to ensure compatiblity with minimum supported version of Asciidoctor (Asciidoctor 2.0.10) (#2363)
32
+
33
+ === Details
34
+
35
+ {url-repo}/releases/tag/v2.3.4[git tag] | {url-repo}/compare/v2.3.3\...v2.3.4[full diff]
36
+
8
37
  == 2.3.3 (2022-10-21) - @mojavelinux
9
38
 
10
39
  Bug Fixes::
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, 2022-10-21
3
+ v2.3.5, 2023-03-31
4
4
  // Settings:
5
5
  :experimental:
6
6
  :idprefix:
@@ -68,7 +68,8 @@ TIP: For the latest Asciidoctor PDF features and fixes, see {url-project-docs}/w
68
68
 
69
69
  == Prerequisites
70
70
 
71
- Asciidoctor PDF is a Ruby application.
71
+ Asciidoctor PDF is built on Asciidoctor.
72
+ Like Asciidoctor, Asciidoctor PDF is a Ruby application.
72
73
  Therefore, to use it, you'll need a Ruby runtime.
73
74
 
74
75
  The supported Ruby runtimes are Ruby 2.7 or greater and JRuby 9.2 or greater.
@@ -93,6 +94,8 @@ Pass the name of the gem to the `gem install` command as follows:
93
94
 
94
95
  Installing Asciidoctor PDF will install a number of other gems mentioned in these docs, including asciidoctor, prawn, prawn-svg, prawn-table, prawn-icon, and ttfunk.
95
96
  For the most part, the versions of these dependencies are locked to the version of Asciidoctor PDF.
97
+ The patch versions are allowed to vary.
98
+ Please note that the minimum supported version of the asciidoctor gem (Asciidoctor) is 2.0.10.
96
99
 
97
100
  For further installation information about installing Asciidoctor PDF, see {url-project-docs}/install/[the installation documentation].
98
101
  For troubleshooting help, see {url-project-docs}/install/#installation-troubleshooting[Installation troubleshooting].
@@ -44,7 +44,7 @@ Gem::Specification.new do |s|
44
44
  s.add_runtime_dependency 'treetop', '~> 1.6.0'
45
45
 
46
46
  s.add_development_dependency 'rake', '~> 13.0.0'
47
- s.add_development_dependency 'rspec', '~> 3.11.0'
47
+ s.add_development_dependency 'rspec', '~> 3.12.0'
48
48
  s.add_development_dependency 'pdf-inspector', '~> 1.3.0'
49
49
  s.add_development_dependency 'chunky_png', '~> 1.4.0'
50
50
  end
@@ -303,8 +303,12 @@ module Asciidoctor
303
303
 
304
304
  if (toc_extent = @toc_extent)
305
305
  if title_page_on && !insert_toc
306
- num_front_matter_pages[0] = toc_extent.to.page if @theme.running_content_start_at == 'after-toc'
307
- num_front_matter_pages[1] = toc_extent.to.page if @theme.page_numbering_start_at == 'after-toc'
306
+ if @theme.running_content_start_at == 'after-toc' || @theme.page_numbering_start_at == 'after-toc' # rubocop:disable Style/SoleNestedConditional
307
+ last_toc_page = toc_extent.to.page
308
+ last_toc_page += 1 if @ppbook && (recto_page? last_toc_page)
309
+ num_front_matter_pages[0] = last_toc_page if @theme.running_content_start_at == 'after-toc'
310
+ num_front_matter_pages[1] = last_toc_page if @theme.page_numbering_start_at == 'after-toc'
311
+ end
308
312
  end
309
313
  toc_page_nums = ink_toc doc, toc_num_levels, toc_extent.from.page, toc_extent.from.cursor, num_front_matter_pages[1]
310
314
  else
@@ -627,7 +631,8 @@ module Asciidoctor
627
631
  sect.context = :open
628
632
  return convert_abstract sect
629
633
  elsif (index_section = sectname == 'index') && @index.empty?
630
- sect.remove
634
+ # override numbered_title to hide entry from TOC
635
+ sect.define_singleton_method :numbered_title, &->(*) { '' }
631
636
  return
632
637
  end
633
638
  title = sect.numbered_title formal: true
@@ -765,7 +770,7 @@ module Asciidoctor
765
770
  def convert_preamble node
766
771
  # FIXME: core should not be promoting paragraph to preamble if there are no sections
767
772
  if (first_block = node.first_child)&.context == :paragraph && node.document.sections? && !first_block.role?
768
- first_block.role = 'lead'
773
+ first_block.set_attr 'role', 'lead'
769
774
  end
770
775
  traverse node
771
776
  theme_margin :block, :bottom, (next_enclosed_block node)
@@ -1244,7 +1249,7 @@ module Asciidoctor
1244
1249
  if !at_page_top? && (has_title || id || (node.option? 'unbreakable'))
1245
1250
  arrange_block node do
1246
1251
  add_dest_for_block node if id
1247
- tare_first_page_content_stream { ink_caption node, labeled: false } if has_title
1252
+ tare_first_page_content_stream { ink_caption node, category: (node.style === 'table-container' ? :table : nil), labeled: false } if has_title
1248
1253
  traverse node
1249
1254
  end
1250
1255
  else
@@ -1364,9 +1369,10 @@ module Asciidoctor
1364
1369
  @list_numerals << (index = @list_numerals.pop).next
1365
1370
  theme_font :conum do
1366
1371
  marker_width = rendered_width_of_string %(#{marker = conum_glyph index}x)
1372
+ marker_font_color = @theme.callout_list_marker_font_color || @font_color
1367
1373
  float do
1368
1374
  bounding_box [bounds.left, cursor], width: marker_width do
1369
- ink_prose marker, align: :center, inline_format: false, margin: 0
1375
+ ink_prose marker, align: :center, inline_format: false, margin: 0, color: marker_font_color
1370
1376
  end
1371
1377
  end
1372
1378
  end
@@ -1968,13 +1974,15 @@ module Asciidoctor
1968
1974
 
1969
1975
  def convert_table node
1970
1976
  if !at_page_top? && ((unbreakable = node.option? 'unbreakable') || ((node.option? 'breakable') && (node.id || node.title?)))
1971
- (table_container = Block.new (table_dup = node.dup), :open) << table_dup
1977
+ # NOTE: we use the current node as the parent so we can navigate back into the document model
1978
+ (table_container = Block.new node, :open) << (table_dup = node.dup)
1972
1979
  if unbreakable
1973
1980
  table_dup.remove_attr 'unbreakable-option'
1974
1981
  table_container.set_attr 'unbreakable-option'
1975
1982
  else
1976
1983
  table_dup.remove_attr 'breakable-option'
1977
1984
  end
1985
+ table_container.style = 'table-container'
1978
1986
  table_container.id, table_dup.id = table_dup.id, nil
1979
1987
  if table_dup.title?
1980
1988
  table_container.title = ''
@@ -3433,8 +3441,9 @@ module Asciidoctor
3433
3441
  val = val.to_s unless ::String === val
3434
3442
  if (val.include? ':') && val =~ ImageAttributeValueRx
3435
3443
  attrlist = $2
3436
- image_attrs = (AttributeList.new attrlist).parse %w(alt width)
3444
+ image_attrs = (::Asciidoctor::AttributeList.new attrlist).parse %w(alt width)
3437
3445
  image_path, image_format = ::Asciidoctor::Image.target_and_format $1, image_attrs
3446
+ image_path = apply_subs_discretely doc, image_path, subs: [:attributes], imagesdir: @themesdir
3438
3447
  if (image_path = resolve_image_path doc, image_path, image_format, @themesdir) && (::File.readable? image_path)
3439
3448
  image_opts = resolve_image_options image_path, image_format, image_attrs, container_size: [colspec_dict[side][position][:width], trim_content_height[side]]
3440
3449
  side_content[position] = [image_path, image_opts, image_attrs['link']]
@@ -3696,7 +3705,7 @@ module Asciidoctor
3696
3705
 
3697
3706
  if @theme.title_page_logo_display != 'none' && (logo_image_path = (doc.attr 'title-logo-image') || (logo_image_from_theme = @theme.title_page_logo_image))
3698
3707
  if (logo_image_path.include? ':') && logo_image_path =~ ImageAttributeValueRx
3699
- logo_image_attrs = (AttributeList.new $2).parse %w(alt width height)
3708
+ logo_image_attrs = (::Asciidoctor::AttributeList.new $2).parse %w(alt width height)
3700
3709
  if logo_image_from_theme
3701
3710
  relative_to_imagesdir = false
3702
3711
  logo_image_path = apply_subs_discretely doc, $1, subs: [:attributes], imagesdir: @themesdir
@@ -4017,7 +4026,9 @@ module Asciidoctor
4017
4026
  end
4018
4027
  siblings = siblings.flatten if parent_context == :dlist
4019
4028
  if block != siblings[-1]
4020
- (self_idx = siblings.index block) && siblings[self_idx + 1]
4029
+ context == :open && block.style == 'table-container' ?
4030
+ (next_enclosed_block parent) :
4031
+ (self_idx = siblings.index block) && siblings[self_idx + 1]
4021
4032
  elsif parent_context == :list_item || (parent_context == :open && parent.style != 'abstract') || parent_context == :section
4022
4033
  next_enclosed_block parent
4023
4034
  elsif list_item && (grandparent = parent.parent).context == :list_item
@@ -4085,7 +4096,7 @@ module Asciidoctor
4085
4096
  elsif image_path == 'none'
4086
4097
  return []
4087
4098
  elsif (image_path.include? ':') && image_path =~ ImageAttributeValueRx
4088
- image_attrs = (AttributeList.new $2).parse %w(alt width)
4099
+ image_attrs = (::Asciidoctor::AttributeList.new $2).parse %w(alt width)
4089
4100
  image_path = $1
4090
4101
  image_relative_to = true
4091
4102
  end
@@ -13,7 +13,7 @@ class Asciidoctor::Document
13
13
  preface.id = preface.generate_id
14
14
  if (first_child = blk0.blocks[0])&.option? 'notitle'
15
15
  preface.set_option 'notitle'
16
- first_child.role = 'lead' if first_child.context == :paragraph && !first_child.role?
16
+ first_child.set_attr 'role', 'lead' if first_child.context == :paragraph && !first_child.role?
17
17
  end
18
18
  preface.blocks.replace (blk0.blocks.map do |b|
19
19
  b.parent = preface
@@ -12,6 +12,7 @@ module Prawn
12
12
 
13
13
  def initialize pdf, opts = {}
14
14
  @font_options = {}
15
+ @align = @valign = @root_font_size = nil
15
16
  super pdf, [], opts
16
17
  end
17
18
 
@@ -41,14 +42,12 @@ module Prawn
41
42
  apply_font_properties do
42
43
  extent = @pdf.dry_run keep_together: true, single_page: true do
43
44
  push_scratch parent_doc
44
- doc.catalog[:footnotes] = parent_doc.catalog[:footnotes]
45
45
  # NOTE: we should be able to use cell.max_width, but returns 0 in some conditions (like when colspan > 1)
46
46
  indent cell.padding_left, bounds.width - cell.width + cell.padding_right do
47
47
  move_down padding_y if padding_y > 0
48
48
  conceal_page_top { traverse cell.content }
49
49
  end
50
50
  pop_scratch parent_doc
51
- doc.catalog[:footnotes] = parent_doc.catalog[:footnotes]
52
51
  end
53
52
  end
54
53
  # NOTE: prawn-table doesn't support cells that exceed the height of a single page
@@ -89,6 +88,8 @@ module Prawn
89
88
  # end
90
89
  # end
91
90
  start_page = pdf.page_number
91
+ parent_doc = (doc = content.document).nested? ? doc.parent_document : doc
92
+ doc.catalog[:footnotes] = parent_doc.catalog[:footnotes]
92
93
  # TODO: apply horizontal alignment; currently it is necessary to specify alignment on content blocks
93
94
  apply_font_properties { pdf.traverse content }
94
95
  if (extra_pages = pdf.page_number - start_page) > 0
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Asciidoctor
4
4
  module PDF
5
- VERSION = '2.3.3'
5
+ VERSION = '2.3.5'
6
6
  end
7
7
  end
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.3
4
+ version: 2.3.5
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: 2022-10-21 00:00:00.000000000 Z
12
+ date: 2023-03-31 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: asciidoctor
@@ -157,14 +157,14 @@ dependencies:
157
157
  requirements:
158
158
  - - "~>"
159
159
  - !ruby/object:Gem::Version
160
- version: 3.11.0
160
+ version: 3.12.0
161
161
  type: :development
162
162
  prerelease: false
163
163
  version_requirements: !ruby/object:Gem::Requirement
164
164
  requirements:
165
165
  - - "~>"
166
166
  - !ruby/object:Gem::Version
167
- version: 3.11.0
167
+ version: 3.12.0
168
168
  - !ruby/object:Gem::Dependency
169
169
  name: pdf-inspector
170
170
  requirement: !ruby/object:Gem::Requirement
@@ -335,7 +335,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
335
335
  - !ruby/object:Gem::Version
336
336
  version: '0'
337
337
  requirements: []
338
- rubygems_version: 3.3.7
338
+ rubygems_version: 3.3.26
339
339
  signing_key:
340
340
  specification_version: 4
341
341
  summary: Converts AsciiDoc documents to PDF using Asciidoctor and Prawn