asciidoctor-pdf 1.5.0 → 1.5.1

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: b745a95bf56222abcbf7b3bb4d86f1b6fa1212db2f7647e80f5afd8b2a7aaf5f
4
- data.tar.gz: f7c78b8f11502cea2922d97fe11f28bcf2d3e55f1597ba4f454d0c32e21e4f91
3
+ metadata.gz: 65bb6f189bb4f178cc3c92701488d3a8ffed51c607a9dca2d80821e7431c2083
4
+ data.tar.gz: 51ab7401ed17a659a0537237bc7a840b261d0218bb3bc18963a33ff346683e13
5
5
  SHA512:
6
- metadata.gz: ccd5ed955367f8580e72583c28ea2754089326e79e80cb443499c41054d545b0bc88ff0225502058b6f5d856dbfd52120a6f52441eb9cd25f50ec5b2afabe83b
7
- data.tar.gz: d3c062fca45030355a179b677794c5fc458872b3990d15f31056c6aef92800765b14bda103d999bfcfa100875f55338f7587779c44fa23ff8ef50ffb27c9fde5
6
+ metadata.gz: 3f486c6c9a9825b87126d910089ba47a2956449e8868e42dfcbca1c29a93f15973f2619e51e911d898855ea80385aceb9bb7b01342d4fd389235a265c02a464e
7
+ data.tar.gz: c452eb12b67a7a2daf1575961d7cb23723944a448aa4fb797a300db4e0a72125968e6a54f54adfc0ee9ed3f7e3f77d7c24bc4a09fd192eb02df7c7fe4ad29da5
@@ -5,6 +5,16 @@
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 {uri-repo}/commits/master[commit history] on GitHub.
7
7
 
8
+ == 1.5.1 (2020-02-16) - @mojavelinux
9
+
10
+ Enhancements::
11
+
12
+ * allow theme to control font color of first line of abstract
13
+
14
+ Fixes::
15
+
16
+ * fix spacing after first line of indented paragraph (#1557)
17
+
8
18
  == 1.5.0 (2020-02-11) - @mojavelinux
9
19
 
10
20
  * support table with multiple head rows & decorate accordingly (#1539)
@@ -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
- v1.5.0, 2020-02-11
3
+ v1.5.1, 2020-02-16
4
4
  // Settings:
5
5
  :experimental:
6
6
  :idprefix:
@@ -23,7 +23,7 @@ endif::[]
23
23
  :project-name: Asciidoctor PDF
24
24
  :project-handle: asciidoctor-pdf
25
25
  // Variables:
26
- :release-version: 1.5.0
26
+ :release-version: 1.5.1
27
27
  // URIs:
28
28
  :url-asciidoctor: http://asciidoctor.org
29
29
  :url-gem: http://rubygems.org/gems/asciidoctor-pdf
@@ -99,6 +99,7 @@ But don't miss the <<Highlights>> to get a preview of what's possible.
99
99
 
100
100
  * Footnotes are always rendered as endnotes (at end of chapter for books; at end of document for all other doctypes)
101
101
  * Table cells that exceed height of a single page will be truncated (see https://github.com/prawnpdf/prawn-table/issues/41[prawn-table#41])
102
+ * Inline images in table cells must fit within available space or Prawn::Errors::CannotFit error will be thrown
102
103
  * Columns cannot be assigned a 0% width (or a width less than the width of a single character); in the same vein, a column cannot be set to autowidth if width of all other columns meets or exceeds 100%; the result is that the converter with throw a Prawn::Errors::CannotFit error
103
104
  * An inline image in a table cell will not force the column wider if the width of the image exceeds the width of the column; either reduce the image width using `pdfwidth` or increase the width of the column using `cols`; another solution is to convert the cell to an AsciiDoc table cell (see https://github.com/asciidoctor/asciidoctor-pdf/issues/830)
104
105
  * Must use development version of prawn-table for autowidth to work on table head row
@@ -207,7 +207,7 @@ example:
207
207
  border_color: $base_border_color
208
208
  border_radius: $base_border_radius
209
209
  border_width: 0.75
210
- background_color: $page-background-color
210
+ background_color: $page_background_color
211
211
  # FIXME reenable padding bottom once margin collapsing is implemented
212
212
  padding: [$vertical_rhythm, $horizontal_rhythm, 0, $horizontal_rhythm]
213
213
  image:
@@ -3511,6 +3511,22 @@ The keys in this category control the arrangement and style of the abstract.
3511
3511
  |abstract:
3512
3512
  padding: [0, 12, 0, 12]
3513
3513
 
3514
+ 3+|[#key-prefix-abstract-first-line]*Key Prefix:* <<key-prefix-abstract-first-line,abstract-first-line>>
3515
+
3516
+ |font-color
3517
+ |<<colors,Color>> +
3518
+ (default: _not set_)
3519
+ |abstract:
3520
+ first-line:
3521
+ font-color: #AA0000
3522
+
3523
+ |font-style
3524
+ |<<font-styles,Font style>> +
3525
+ (default: _not set_)
3526
+ |abstract:
3527
+ first-line:
3528
+ font-style: bold
3529
+
3514
3530
  3+|[#key-prefix-abstract-title]*Key Prefix:* <<key-prefix-abstract-title,abstract-title>>
3515
3531
 
3516
3532
  |align
@@ -226,7 +226,7 @@ module Asciidoctor
226
226
  zero_page_offset = has_front_cover ? 1 : 0
227
227
  first_page_offset = has_title_page ? zero_page_offset.next : zero_page_offset
228
228
  body_offset = (body_start_page_number = page_number) - 1
229
- if Integer === (running_content_start_at = @theme.running_content_start_at || 'body')
229
+ if ::Integer === (running_content_start_at = @theme.running_content_start_at || 'body')
230
230
  running_content_body_offset = body_offset + [running_content_start_at.pred, 1].max
231
231
  running_content_start_at = 'body'
232
232
  else
@@ -234,7 +234,7 @@ module Asciidoctor
234
234
  running_content_start_at = 'toc' if running_content_start_at == 'title' && !has_title_page
235
235
  running_content_start_at = 'body' if running_content_start_at == 'toc' && !insert_toc
236
236
  end
237
- if Integer === (page_numbering_start_at = @theme.page_numbering_start_at || 'body')
237
+ if ::Integer === (page_numbering_start_at = @theme.page_numbering_start_at || 'body')
238
238
  page_numbering_body_offset = body_offset + [page_numbering_start_at.pred, 1].max
239
239
  page_numbering_start_at = 'body'
240
240
  else
@@ -644,10 +644,14 @@ module Asciidoctor
644
644
  if (text_indent = @theme.prose_text_indent || 0) > 0
645
645
  prose_opts[:indent_paragraphs] = text_indent
646
646
  end
647
- # FIXME: control more first_line_options using theme
647
+ # FIXME: allow theme to control more first line options
648
648
  if (line1_font_style = @theme.abstract_first_line_font_style) && line1_font_style.to_sym != font_style
649
- prose_opts[:first_line_options] = { styles: [font_style, line1_font_style.to_sym] }
649
+ first_line_options = { styles: [font_style, line1_font_style.to_sym] }
650
650
  end
651
+ if (line1_font_color = @theme.abstract_first_line_font_color)
652
+ (first_line_options ||= {})[:color] = line1_font_color
653
+ end
654
+ prose_opts[:first_line_options] = first_line_options if first_line_options
651
655
  # FIXME: make this cleaner!!
652
656
  if node.blocks?
653
657
  node.blocks.each do |child|
@@ -369,14 +369,26 @@ module Asciidoctor
369
369
  end
370
370
  end
371
371
 
372
- # NOTE override built-in draw_indented_formatted_line to insert leading before second line
373
- def draw_indented_formatted_line string, opts
374
- result = super
375
- unless @no_text_printed || @all_text_printed
376
- # as of Prawn 1.2.1, we have to handle the line gap after the first line manually
377
- move_down opts[:leading]
372
+ # NOTE override built-in fill_formatted_text_box to insert leading before second line when :first_line is true
373
+ def fill_formatted_text_box text, opts
374
+ merge_text_box_positioning_options opts
375
+ box = ::Prawn::Text::Formatted::Box.new text, opts
376
+ remaining_text = box.render
377
+ @no_text_printed = box.nothing_printed?
378
+ @all_text_printed = box.everything_printed?
379
+
380
+ if @final_gap || (opts[:first_line] && !(@no_text_printed || @all_text_printed))
381
+ self.y -= box.height + box.line_gap + box.leading
382
+ else
383
+ self.y -= box.height
378
384
  end
379
- result
385
+
386
+ remaining_text
387
+ end
388
+
389
+ # NOTE override built-in draw_indented_formatted_line to set first_line flag
390
+ def draw_indented_formatted_line string, opts
391
+ super string, (opts.merge first_line: true)
380
392
  end
381
393
 
382
394
  # Performs the same work as Prawn::Text.text except that the first_line_opts are applied to the first line of text
@@ -395,7 +407,7 @@ module Asciidoctor
395
407
  first_line_color = (first_line_opts.delete :color) || color
396
408
  opts = opts.merge document: self
397
409
  # QUESTION should we merge more carefully here? (hand-select keys?)
398
- first_line_opts = opts.merge(first_line_opts).merge single_line: true
410
+ first_line_opts = opts.merge(first_line_opts).merge single_line: true, first_line: true
399
411
  box = ::Prawn::Text::Formatted::Box.new fragments, first_line_opts
400
412
  # NOTE get remaining_fragments before we add color to fragments on first line
401
413
  if (text_indent = opts.delete :indent_paragraphs)
@@ -417,8 +429,6 @@ module Asciidoctor
417
429
  unless remaining_fragments.empty?
418
430
  # NOTE color must be applied per-fragment
419
431
  remaining_fragments.each {|fragment| fragment[:color] ||= color } if color
420
- # as of Prawn 1.2.1, we have to handle the line gap after the first line manually
421
- move_down opts[:leading]
422
432
  remaining_fragments = fill_formatted_text_box remaining_fragments, opts
423
433
  draw_remaining_formatted_text_on_new_pages remaining_fragments, opts
424
434
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module Asciidoctor::Pdf::FormattedText
3
+ module Asciidoctor::PDF::FormattedText
4
4
  module TextBackgroundAndBorderRenderer
5
5
  module_function
6
6
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Asciidoctor
4
4
  module PDF
5
- VERSION = '1.5.0'
5
+ VERSION = '1.5.1'
6
6
  end
7
7
  Pdf = PDF unless const_defined? :Pdf, false
8
8
  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: 1.5.0
4
+ version: 1.5.1
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: 2020-02-11 00:00:00.000000000 Z
12
+ date: 2020-02-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: asciidoctor