asciidoctor-pdf 2.3.4 → 2.3.6

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: a7fc3e4ac6264ca5d67d9c980104469ff87c54c52e869eec934a70bb938b99ca
4
- data.tar.gz: 941b80f09b9828d4320f7e18dda3ec984885ef7cd9e6e71e7066692ce795814b
3
+ metadata.gz: ffe3647066c0eb782783dc3c76aa5b179637088729e48cbf49659c6a755ee92b
4
+ data.tar.gz: 945e6675e7d2e4073bbb3779824f6e65d75d237da22416c39212f3e501175606
5
5
  SHA512:
6
- metadata.gz: '09df883eb6acf49084ae6b504c6f7c4a51cc9d3e1aa5119c960931c44d74bf65c7838a704b4a45d07bcf2b6a3089bd52e3ae76d5f8c29fe98cb2cac05cf1fec0'
7
- data.tar.gz: f1a1bfdb597da670a59cebf59bd4989afe5f342cc4be4c1cc76a5f8fa6704d367395e5d7684a2c8d48f57cc5116ff422237c9e672a5ab9bdb2db6da21b9d98d5
6
+ metadata.gz: 69dfbad655ec87a98630d269654b007a9590b5107ce68e9c9b0c66fcead3d8735afa865d7bb8260af81c7f36cf9848a974655f950b0ae8538448adc994e84f2d
7
+ data.tar.gz: 469e1fe5e4d2d3f4e9dcf2b46f2fefb85fc45011710c751d52d4c09f86d4e212098e7a386af17ce6fe4ebe452efe613f57148373b667b1872e2a8a76d4eff53f
data/CHANGELOG.adoc CHANGED
@@ -5,6 +5,34 @@
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.6 (2023-04-09) - @mojavelinux
9
+
10
+ Bug Fixes::
11
+
12
+ * rework `File.absolute_path?` patch so it returns correct response when running on JRuby
13
+
14
+ === Details
15
+
16
+ {url-repo}/releases/tag/v2.3.6[git tag] | {url-repo}/compare/v2.3.5\...v2.3.6[full diff]
17
+
18
+ == 2.3.5 (2023-03-31) - @mojavelinux
19
+
20
+ Enhancements::
21
+
22
+ * add `callout-list-marker-font-color` theme key to control color of conum marker in callout list (#2402)
23
+
24
+ Bug Fixes::
25
+
26
+ * catalog all footnotes found inside AsciiDoc table cells and render them in the footnotes list (#2410)
27
+ * do not drop section that follows empty index (#2368)
28
+ * restore bottom margin on table with `breakable` or `unbreakable` option (#2379)
29
+ * honor theme settings for caption on table with `breakable` or `unbreakable` option (#2379)
30
+ * use first recto page after toc when media is prepress and page numbering or running content start-at value is `after-toc` (#2398)
31
+
32
+ === Details
33
+
34
+ {url-repo}/releases/tag/v2.3.5[git tag] | {url-repo}/compare/v2.3.4\...v2.3.5[full diff]
35
+
8
36
  == 2.3.4 (2022-10-29) - @mojavelinux
9
37
 
10
38
  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.4, 2022-10-29
3
+ v2.3.6, 2023-04-09
4
4
  // Settings:
5
5
  :experimental:
6
6
  :idprefix:
@@ -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
@@ -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,7 +3441,7 @@ 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
3438
3446
  image_path = apply_subs_discretely doc, image_path, subs: [:attributes], imagesdir: @themesdir
3439
3447
  if (image_path = resolve_image_path doc, image_path, image_format, @themesdir) && (::File.readable? image_path)
@@ -3697,11 +3705,11 @@ module Asciidoctor
3697
3705
 
3698
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))
3699
3707
  if (logo_image_path.include? ':') && logo_image_path =~ ImageAttributeValueRx
3700
- logo_image_attrs = (AttributeList.new $2).parse %w(alt width height)
3708
+ logo_image_attrs = (::Asciidoctor::AttributeList.new $2).parse %w(alt width height)
3701
3709
  if logo_image_from_theme
3702
3710
  relative_to_imagesdir = false
3703
3711
  logo_image_path = apply_subs_discretely doc, $1, subs: [:attributes], imagesdir: @themesdir
3704
- logo_image_path = ThemeLoader.resolve_theme_asset logo_image_path, @themesdir unless doc.is_uri? logo_image_path
3712
+ logo_image_path = ThemeLoader.resolve_theme_asset logo_image_path, @themesdir unless (::File.absolute_path? logo_image_path) || (doc.is_uri? logo_image_path)
3705
3713
  else
3706
3714
  relative_to_imagesdir = true
3707
3715
  logo_image_path = $1
@@ -3711,7 +3719,7 @@ module Asciidoctor
3711
3719
  relative_to_imagesdir = false
3712
3720
  if logo_image_from_theme
3713
3721
  logo_image_path = apply_subs_discretely doc, logo_image_path, subs: [:attributes], imagesdir: @themesdir
3714
- logo_image_path = ThemeLoader.resolve_theme_asset logo_image_path, @themesdir unless doc.is_uri? logo_image_path
3722
+ logo_image_path = ThemeLoader.resolve_theme_asset logo_image_path, @themesdir unless (::File.absolute_path? logo_image_path) || (doc.is_uri? logo_image_path)
3715
3723
  end
3716
3724
  end
3717
3725
  if (::Asciidoctor::Image.target_and_format logo_image_path)[1] == 'pdf'
@@ -4018,7 +4026,9 @@ module Asciidoctor
4018
4026
  end
4019
4027
  siblings = siblings.flatten if parent_context == :dlist
4020
4028
  if block != siblings[-1]
4021
- (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]
4022
4032
  elsif parent_context == :list_item || (parent_context == :open && parent.style != 'abstract') || parent_context == :section
4023
4033
  next_enclosed_block parent
4024
4034
  elsif list_item && (grandparent = parent.parent).context == :list_item
@@ -4086,7 +4096,7 @@ module Asciidoctor
4086
4096
  elsif image_path == 'none'
4087
4097
  return []
4088
4098
  elsif (image_path.include? ':') && image_path =~ ImageAttributeValueRx
4089
- image_attrs = (AttributeList.new $2).parse %w(alt width)
4099
+ image_attrs = (::Asciidoctor::AttributeList.new $2).parse %w(alt width)
4090
4100
  image_path = $1
4091
4101
  image_relative_to = true
4092
4102
  end
@@ -1,8 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class File
4
- # NOTE: remove once minimum JRuby version is fully 2.7 compliant
5
- def self.absolute_path? path
6
- (::Pathname.new path).absolute?
7
- end unless respond_to? :absolute_path?
8
- end
3
+ File.singleton_class.prepend (Module.new do
4
+ # NOTE: JRuby < 9.4 doesn't implement this method; JRuby 9.4 implements it incorrectly
5
+ def absolute_path? path
6
+ (::Pathname.new path).absolute? && !(%r/\A[[:alpha:]][[:alnum:]\-+]*:\/\/\S/.match? path)
7
+ end
8
+ end) if RUBY_ENGINE == 'jruby'
@@ -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.4'
5
+ VERSION = '2.3.6'
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.4
4
+ version: 2.3.6
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-29 00:00:00.000000000 Z
12
+ date: 2023-04-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: asciidoctor
@@ -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