asciidoctor-pdf 2.1.5 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0cacde45fb257acbe2644ae3da1673e0a9fe9cd42f4b97de92a3ae2d97400fdb
4
- data.tar.gz: e4e01d9fa4e923e598277c5db822632a5dc3fe67e51ebbea26d744f8d30e7315
3
+ metadata.gz: fa858819d28baa5f07261f05d2ac3694e571683f3c99b9cbf80b11bd7d79c4b3
4
+ data.tar.gz: 243f4f2a35fcd2d3a2d6c9449499c3097804865abe137058dd55975970fbded9
5
5
  SHA512:
6
- metadata.gz: 2fadd03cc382136bf1387867d83d68396f58c4182a51616254562c1d6460e28e0555781e9c5c51d372cd6d3fee29f80b7c06d9fc0d6e055a2839cf63491bf92d
7
- data.tar.gz: 6fa97a16ff15ac5b0dee3789d33aa2760595139299ae41eb4e0104b4346c8569ffb8f1377fd0844f2c98ec831a08156258754e2a54f25c9fb10972a681f0c592
6
+ metadata.gz: 64571af8d39650e26245fd746675c8af1b3b98ee0b8b6d2de705acaf93849bbc5ed51ae36543ac06105e102b79ed698a24676ca76d63c91213399bd029b58e85
7
+ data.tar.gz: f446904f582d0d423c9ea918a23bff541ec65be94e0be7b94a07e1e190a6e66ee4aeb2c7ad403c61773708feb30adb2949e2822a56f7f0c3bd1b291191225c48
data/CHANGELOG.adoc CHANGED
@@ -5,16 +5,83 @@
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.1.5 (2022-07-10) - @mojavelinux
8
+ == 2.3.0 (2022-08-16) - @mojavelinux
9
+
10
+ Enhancements::
11
+
12
+ * place footnotes directly below last block of content if `footnotes-margin-top` theme key is 0 (#2291)
13
+ * allow page / column break to be forced using `always` option (e.g., `[%always]`) (#2300)
14
+ * insert column break instead of page break in multi-column layout if `column` role is specified on page break macro (#2293)
15
+ * use relative font size for big and small roles (#2307)
16
+ * use default-for-print theme by default if media is `print` or `prepress` (#2306)
17
+ * support text alignment roles on all styled paragraphs
18
+ * support text alignment roles on verse block
9
19
 
10
20
  Bug Fixes::
11
21
 
12
- * fix position of background color on caption with outside margin (#2271)
13
- * don't allow font scale to compound when entering nested table (#2276)
22
+ * only indent text that starts at left margin (i.e., when text align is left or justify) (#2298)
23
+ * apply text transform and formatting when checking height of heading for orphan prevention
24
+ * apply text transform and formatting when computing height of background for caption
25
+ * honor theme settings (`prose-margin-inner` and `prose-text-indent-inner`) for inner paragraphs in abstract
26
+ * prevent footnote label from being split across lines (#2297)
27
+ * keep footnote label with preceding text if adjacent (#2297)
28
+ * strip formatting added to source block by custom subs when syntax highlighter is enabled (#2086)
29
+
30
+ Compliance::
31
+
32
+ * remove support for deprecated `spread` role on table
14
33
 
15
34
  === Details
16
35
 
17
- {url-repo}/releases/tag/v2.1.5[git tag] | {url-repo}/compare/v2.1.4\...v2.1.5[full diff]
36
+ {url-repo}/releases/tag/v2.3.0[git tag] | {url-repo}/compare/v2.2.0\...v2.3.0[full diff]
37
+
38
+ == 2.2.0 (2022-07-22) - @mojavelinux
39
+
40
+ Enhancements::
41
+
42
+ * allow page background image to be specified per layout using `+{page-layout}+` attribute reference in path (#1739)
43
+ * allow page margin for rotated page to be configured independently using `page-margin-rotated` theme key or `pdf-page-margin-rotated` document attribute (#1719)
44
+ * allow orphan detection to be enabled for all section titles and discrete headings by setting `heading-min-height-after` to `auto` in theme (#2268)
45
+ * set `docimagesdir` attribute when attribute substitutions are applied to value from theme (#2278)
46
+ * start page numbering and running content on empty verso page before first chapter of prepress book if `start-at` value is 0 (#2252)
47
+ * don't force page break after TOC with automatic placement in article if `title-page` attribute is set and value of `toc-break-after` theme key is `auto` (#1768)
48
+ * add `--theme` option to CLI as shorthand for `-a pdf-theme` (#2250)
49
+ * add `--sourcemap` option to CLI to enable `:sourcemap` option on processor (#2265)
50
+ * broaden support for relative font sizes in theme to more than just inline elements; document support for relative font sizes
51
+ * allow theme to control font properties of marker for ordered list using `olist-marker` category (#2279)
52
+ * allow theme to control font style of marker (per marker or all markers) for unordered list
53
+
54
+ Improvements::
55
+
56
+ * add internal `Document#attr_unspecified?` method to simplify check for an attribute which has not been set or unset
57
+
58
+ Bug Fixes::
59
+
60
+ * always set `imagesdir` attribute to value of `themesdir` when resolving images from theme
61
+ * allow `top` keys in `title-page` theme category to accept a fixed value (e.g., `1in`) (#2269)
62
+ * prevent orphan detection for heading (section title or discrete heading) from modifying document state (#2288)
63
+
64
+ Compliance::
65
+
66
+ * configure table borders in way that is compatible with prawn-table > 0.2.2
67
+ * don't coerce font size < 1 to relative font size; relative font size should be specified in units
68
+
69
+ === Details
70
+
71
+ {url-repo}/releases/tag/v2.2.0[git tag] | {url-repo}/compare/v2.1.6\...v2.2.0[full diff]
72
+
73
+ == 2.1.6 (2022-07-19) - @mojavelinux
74
+
75
+ Bug Fixes::
76
+
77
+ * resolve font size for monospaced cell when font size value on `codespan` key in theme is relative (#2281)
78
+
79
+ == 2.1.5 (2022-07-10) - @mojavelinux
80
+
81
+ Bug Fixes::
82
+
83
+ * fix position of background color on caption with outside margin (#2271)
84
+ * don't allow font scale to compound when entering nested table (#2276)
18
85
 
19
86
  == 2.1.4 (2022-06-26) - @mojavelinux
20
87
 
@@ -28,10 +95,6 @@ Bug Fixes::
28
95
  * apply text-tranform from custom role on phrase after attributes have been resolved (#2263)
29
96
  * make URL check more strict so image target containing a colon is not mistaken as a URL
30
97
 
31
- === Details
32
-
33
- {url-repo}/releases/tag/v2.1.4[git tag] | {url-repo}/compare/v2.1.3\...v2.1.4[full diff]
34
-
35
98
  == 2.1.3 (2022-06-23) - @mojavelinux
36
99
 
37
100
  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.1.5, 2022-07-10
3
+ v2.3.0, 2022-08-16
4
4
  // Settings:
5
5
  :experimental:
6
6
  :idprefix:
data/bin/asciidoctor-pdf CHANGED
@@ -8,17 +8,36 @@ else
8
8
  end
9
9
  require 'asciidoctor/cli'
10
10
 
11
- options = Asciidoctor::Cli::Options.new backend: 'pdf', header_footer: true
11
+ # FIXME: provide an API in Asciidoctor for sub-projects to prepend version information
12
+ options = (Asciidoctor::Cli::Options.new backend: 'pdf', header_footer: true).extend (Module.new do
13
+ def print_version os = $stdout
14
+ os.write %(Asciidoctor PDF #{Asciidoctor::PDF::VERSION} using )
15
+ super
16
+ end
17
+ end)
12
18
 
13
- # FIXME: provide an API in Asciidoctor for sub-components to print version information
14
- unless ARGV != ['-v'] && (ARGV & ['-V', '--version']).empty?
15
- $stdout.write %(Asciidoctor PDF #{Asciidoctor::PDF::VERSION} using )
16
- options.print_version
17
- exit 0
19
+ args = ARGV.dup
20
+
21
+ if (theme_idx = args.index {|it| it == '--theme' || (it.start_with? '--theme=') })
22
+ if (theme_arg = args[theme_idx]).length > 7
23
+ args[theme_idx..theme_idx] = ['-a', %(pdf#{theme_arg.slice 1, theme_arg.length})]
24
+ elsif (val = args[theme_idx + 1]) && !(val.start_with? '-')
25
+ args[theme_idx] = '-a'
26
+ args[theme_idx + 1] = %(pdf-theme=#{val})
27
+ end
28
+ end
29
+
30
+ if (Gem::Version.new Asciidoctor::VERSION) < (Gem::Version.new '2.1.0') && (args.include? '--sourcemap')
31
+ args.delete '--sourcemap'
32
+ Asciidoctor::Extensions.register do
33
+ preprocessor do
34
+ process {|doc| (doc.sourcemap = true) && nil }
35
+ end
36
+ end
18
37
  end
19
38
 
20
39
  # FIXME: This is a really bizarre API. Please make me simpler.
21
- case (result = options.parse! ARGV)
40
+ case (result = options.parse! args)
22
41
  when Integer
23
42
  exit result
24
43
  else
@@ -1,8 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
  # frozen_string_literal: true
3
3
 
4
- optimizer = File.absolute_path '../lib/asciidoctor/pdf/optimizer.rb', __dir__
5
- if File.exist? optimizer
4
+ if File.file? (optimizer = File.join (File.dirname __dir__), 'lib/asciidoctor/pdf/optimizer.rb')
6
5
  require optimizer
7
6
  else
8
7
  require 'asciidoctor/pdf/optimizer'
@@ -17,8 +17,8 @@ base_border_color: '000000'
17
17
  role_lead_font_size: 13.5
18
18
  role_line-through_text_decoration: line-through
19
19
  role_underline_text_decoration: underline
20
- role_big_font_size: 14
21
- role_small_font_size: 10
20
+ role_big_font_size: 1.2em
21
+ role_small_font_size: 0.8em
22
22
  role_subtitle_font_size: 0.8em
23
23
  button_content: '[%s]'
24
24
  button_font_family: Courier
@@ -23,28 +23,14 @@ page:
23
23
  size: A4
24
24
  base:
25
25
  text_align: justify
26
- # color as hex string (leading # is optional)
27
26
  font_color: 333333
28
- # color as RGB array
29
- #font_color: [51, 51, 51]
30
- # color as CMYK array (approximated)
31
- #font_color: [0, 0, 0, 0.92]
32
- #font_color: [0, 0, 0, 92%]
33
27
  font_family: Noto Serif
34
- # choose one of these font_size/line_height_length combinations
35
- #font_size: 14
36
- #line_height_length: 20
37
- #font_size: 11.25
38
- #line_height_length: 18
39
- #font_size: 11.2
40
- #line_height_length: 16
41
28
  font_size: 10.5
42
- #line_height_length: 15
43
- # correct line height for Noto Serif metrics
29
+ # line_height_length is really just a vertical spacing variable; it's not actually the height of a line
44
30
  line_height_length: 12
45
- #font_size: 11.25
46
- #line_height_length: 18
47
- line_height: $base_line_height_length / $base_font_size
31
+ # The Noto font family has a built-in line height of 1.36
32
+ # With this line_height, a line of text will occupy a height of 15.78pt
33
+ line_height: $base_line_height_length / 10.5
48
34
  font_size_large: round($base_font_size * 1.25)
49
35
  font_size_small: round($base_font_size * 0.85)
50
36
  font_size_min: $base_font_size * 0.75
@@ -60,16 +46,13 @@ role:
60
46
  underline:
61
47
  text_decoration: underline
62
48
  big:
63
- font_size: $base_font_size_large
49
+ font_size: 1.2em
64
50
  small:
65
- font_size: $base_font_size_small
51
+ font_size: 0.8em
66
52
  subtitle:
67
53
  font_color: 999999
68
54
  font_size: 0.8em
69
55
  font_style: normal_italic
70
- # FIXME vertical_rhythm is weird; we should think in terms of ems
71
- #vertical_rhythm: $base_line_height_length * 2 / 3
72
- # correct line height for Noto Serif metrics (comes with built-in line height)
73
56
  vertical_rhythm: $base_line_height_length
74
57
  horizontal_rhythm: $base_line_height_length
75
58
  link:
@@ -107,8 +90,7 @@ heading:
107
90
  h4_font_size: $base_font_size_large
108
91
  h5_font_size: $base_font_size
109
92
  h6_font_size: $base_font_size_small
110
- #line_height: 1.4
111
- # correct line height for Noto Serif metrics (comes with built-in line height)
93
+ # rely on built-in line height in Noto
112
94
  line_height: 1
113
95
  margin_top: $vertical_rhythm * 0.4
114
96
  margin_bottom: $vertical_rhythm * 0.9
@@ -156,11 +138,6 @@ admonition:
156
138
  column_rule_color: $base_border_color
157
139
  column_rule_width: $base_border_width
158
140
  padding: [$vertical_rhythm / 3.0, $horizontal_rhythm, $vertical_rhythm / 3.0, $horizontal_rhythm]
159
- #icon:
160
- # tip:
161
- # name: far-lightbulb
162
- # stroke_color: 111111
163
- # size: 24
164
141
  label:
165
142
  text_transform: uppercase
166
143
  font_style: bold