asciidoctor-pdf 1.5.0.alpha.12 → 1.5.0.alpha.13

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.adoc +325 -0
  3. data/Gemfile +1 -1
  4. data/README.adoc +97 -43
  5. data/asciidoctor-pdf.gemspec +7 -6
  6. data/data/fonts/mplus1mn-bold-ascii.ttf +0 -0
  7. data/data/fonts/mplus1mn-bold_italic-ascii.ttf +0 -0
  8. data/data/fonts/mplus1mn-italic-ascii.ttf +0 -0
  9. data/data/fonts/mplus1mn-regular-ascii-conums.ttf +0 -0
  10. data/data/fonts/notoserif-bold-subset.ttf +0 -0
  11. data/data/fonts/notoserif-bold_italic-subset.ttf +0 -0
  12. data/data/fonts/notoserif-italic-subset.ttf +0 -0
  13. data/data/fonts/notoserif-regular-subset.ttf +0 -0
  14. data/data/themes/default-theme.yml +22 -13
  15. data/docs/theming-guide.adoc +276 -110
  16. data/lib/asciidoctor-pdf/asciidoctor_ext/image.rb +7 -7
  17. data/lib/asciidoctor-pdf/asciidoctor_ext/list.rb +24 -1
  18. data/lib/asciidoctor-pdf/asciidoctor_ext/list_item.rb +3 -3
  19. data/lib/asciidoctor-pdf/asciidoctor_ext/section.rb +11 -3
  20. data/lib/asciidoctor-pdf/converter.rb +614 -401
  21. data/lib/asciidoctor-pdf/core_ext.rb +1 -0
  22. data/lib/asciidoctor-pdf/core_ext/array.rb +2 -2
  23. data/lib/asciidoctor-pdf/core_ext/numeric.rb +1 -1
  24. data/lib/asciidoctor-pdf/core_ext/ostruct.rb +10 -2
  25. data/lib/asciidoctor-pdf/core_ext/string.rb +11 -0
  26. data/lib/asciidoctor-pdf/formatted_text/inline_image_arranger.rb +2 -2
  27. data/lib/asciidoctor-pdf/formatted_text/inline_image_renderer.rb +5 -5
  28. data/lib/asciidoctor-pdf/formatted_text/transform.rb +6 -4
  29. data/lib/asciidoctor-pdf/implicit_header_processor.rb +1 -1
  30. data/lib/asciidoctor-pdf/pdf_core_ext/page.rb +1 -1
  31. data/lib/asciidoctor-pdf/prawn_ext/coderay_encoder.rb +3 -3
  32. data/lib/asciidoctor-pdf/prawn_ext/extensions.rb +77 -28
  33. data/lib/asciidoctor-pdf/prawn_ext/font/afm.rb +5 -4
  34. data/lib/asciidoctor-pdf/prawn_ext/images.rb +1 -1
  35. data/lib/asciidoctor-pdf/roman_numeral.rb +11 -4
  36. data/lib/asciidoctor-pdf/rouge_ext/formatters/prawn.rb +9 -9
  37. data/lib/asciidoctor-pdf/theme_loader.rb +16 -3
  38. data/lib/asciidoctor-pdf/version.rb +1 -1
  39. metadata +18 -9
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e5b988f6863043a9a22bf55cdbbef3a12a9c9a16
4
- data.tar.gz: a623fe7f63d9311404fadca17ff1f17f97b13add
3
+ metadata.gz: ed86baf3f76110d88dcb2e25c13f99a22fdaa42c
4
+ data.tar.gz: bc58645703cf1a7682d6032765c193c077ca49ec
5
5
  SHA512:
6
- metadata.gz: 1311807ce5e4b061faddbb7dd2cce3bc8f563c4a004849f082de2a8e625e90b1d097524e26e1bc97a21b3f363f5de262c649f6888c009e2cd6a6234135d95b21
7
- data.tar.gz: b296d8fbc882739a27b033032c0be761fb0cc9ad0b03a245865e2869be49d8608d9f6b64fc43af061c369c99b217c6846a5da66a14a8dafb3751942e8a1eef66
6
+ metadata.gz: 9fad7aff67713993469f08ff73ee9ff8a81d29c0182d4c38c93830561b9c3e149fe159b9b4ef9fe71a3e4faa831d795251d1691cbddc803e2b2a2cc34030a561
7
+ data.tar.gz: 3c07404a84deb2aac522cac10d0ab56ecd174e3349aec168105ecc79e9f5232c6586204617d230f45ea206b6c3936912b3e28c448c3c7f515fecd40fcff93c5b
@@ -0,0 +1,325 @@
1
+ = {project-name} Changelog
2
+ :project-name: Asciidoctor PDF
3
+ :uri-repo: https://github.com/asciidoctor/asciidoctor-pdf
4
+
5
+ This document provides a high-level view of the changes to the {project-name} by release.
6
+ For a detailed view of what has changed, refer to the {uri-repo}/commits/master[commit history] on GitHub.
7
+
8
+ == 1.5.0.alpha.13 (2016-09-19) - @mojavelinux
9
+
10
+ * Add support for double-sided (recto/verso) margins when media=prepress attribute is set (#383)
11
+ * Add non-breaking hyphen glyph to built-in fonts so its intended behavior is honored (#462)
12
+ * Add page break before a book part (#329)
13
+ * Allow running (header/footer) content to be arrange in columns (#449)
14
+ * Prevent the SVG from modifying the document font (#494)
15
+ * Implement decorative border for multipage quote and verse blocks (#270, #557, #558)
16
+ * Encode anchors in hex that contain characters outside of ASCII range (#481, #301)
17
+ * Size the line number gutter correctly (accounting for width of largest line number) (#402)
18
+ * Allow theme to specify default value for pdfwidth attribute on image and document in README (#455)
19
+ * Fix front matter page numbering by adding page labels for all front matter pages in outline (#458)
20
+ * Allow image type to be specified explicitly using format attribute on image macro (#540)
21
+ * Add support for literal and verse table cell styles
22
+ * Preserve indentation in literal and verse table cells
23
+ * Preserve paragraph breaks in normal table cells
24
+ * Honor value of width attribute even when autowidth option is set on table (#519)
25
+ * Allow font properties to be set per element in running content (#454)
26
+ * Align table title to left edge of table, regardless of table alignment (#469)
27
+ * Add support for reversed option on ordered list (#491)
28
+ * Don't drop whitespace in front of conum on final line of source block (#470)
29
+ * Add more control over position of elements on title page, including support for vw units (#418)
30
+ * Allow table caption position/side to be controlled by theme (#531)
31
+ * Use base_align setting from theme as default alignment for headings
32
+ * Resolve bare image-related attribute values relative to base_dir
33
+ * Only allow Prawn SVG to fetch remote images if the allow-uri-read attribute is set (#548)
34
+ * Introduce page_margin_inner and page_margin_outer keys to theme
35
+ * Start title page, toc, main content, parts, and chapters on recto page when media=prepress and doctype=book
36
+ * Allow default font style for table to be set via theme (table_font_style)
37
+ * Use correct default bullet per nested unordered list level (#529)
38
+ * Call start_new_part at start of each book part
39
+ * Delegate to layout_part_title method to layout part title
40
+ * Don't match a special section as a chapter unless the doctype is book
41
+ * Fix list marker placement when list item touches bottom of page
42
+ * Eliminate excessive spacing between list items that contain nested lists
43
+ * Drop lines in running (header/footer) content with unresolved attributes (#522)
44
+ * Ensure start_new_chapter is always executed at a chapter transition (#524)
45
+ * Add support for root xref (e.g., <<included-doc#>>) (#521)
46
+ * Prevent block from spilling to next page if there's no more content (#361)
47
+ * Add support for px units to pdf-page-size attribute
48
+ * Fix parsing error when value of pdf-page-size attribute is unitless
49
+ * Don't crash if table is empty (#480)
50
+ * Don't crash when deleting last remaining page; don't delete last page if empty
51
+ * Don't orphan space between conums when extracting from verbatim block (#506)
52
+ * Properly scope attr and attr? lookups
53
+ * Rename internal page_start and page_end attributes to pdf-page-start and pdf-page-end, respectively
54
+ * Fix settings for table header cell
55
+ * Fix padding around content of quote block in default theme
56
+ * Read theme file with UTF-8 encoding (#533)
57
+ * Allow temporary image file to be deleted on Windows (#425)
58
+ * Don't crash if theme file is empty (#551)
59
+ * Don't crash if cover image can't be read; warn instead
60
+ * Clarify in theming guide how to write numbers with 3 or more digits (#555)
61
+ * Document how inline images are sized
62
+ * Document how to disable default footer from theme
63
+ * Update explanation of WINANSI encoding behavior in theming guide
64
+ * Restore support for Ruby 1.9.3 (#528)
65
+ * Upgrade prawn-icon to 1.2.0 (which upgrades Font Awesome to 4.6.3)
66
+ * Upgrade prawn-svg to 0.25.2 (by way of more lenient version range)
67
+ * Fix Ruby warnings
68
+ * Document in README how image paths are resolved
69
+ * Configure README for better preview on GitHub
70
+ * Update chronicles example to modern AsciiDoc syntax; update content
71
+
72
+ == 1.5.0.alpha.12 (2016-08-05) - @mojavelinux
73
+
74
+ * Fix incompatibility with Rouge 2 source highlighter (#471)
75
+ * Declare rouge gem in Gemfile for use with examples
76
+ * Add option to make URLs visible in printed PDF using show-link-uri or media=print attributes (#435, #463)
77
+ * Document options for scaling an image (#453)
78
+ * Add support for images to span width of page (#424)
79
+ * Fix embedding of remote images; fix case when imagesdir is a URI (#467)
80
+ * Collapse non-significant whitespace (#465)
81
+ * Document how to inherit font size for a given heading level (#460)
82
+ * Decode character references in link URIs (#448)
83
+ * Use arrow as caret for menu path instead of pipe (#441)
84
+ * Document theme-related AsciiDoc attributes in theming guide (#428)
85
+ * Section title alignment should be customizable via theme (#343)
86
+ * Collapse all whitespace when normalizing (#355)
87
+ * Require space on either side of math operator to avoid interpretting dates as math equations (#429)
88
+ * Allow specifying a font style for a title on the title page (#423)
89
+ * Fix Prawn SVG to support arrow heads on lines (#75)
90
+ * Upgrade prawn-svg to 0.25.1
91
+ * Upgrade prawn-icon to 1.1.0
92
+ * Fix rendering of two images in header or footer (#421)
93
+ * Allow table grid color and width to be controlled by theme (@ntfc)
94
+ * Fix undefined local variable or method `dest_y' when adding auto-generated anchor to section (#419)
95
+ * SVG files that include image elements are not rendered correctly improvement (@AlexanderZobkov) (#414)
96
+ * Fix Prawn SVG to support currentColor keyword (#407)
97
+ * Parser should recognize up to 6 digit character references (#404)
98
+ * Properly convert a negative measurement value in theme
99
+ * Coerce percentage value to float instead of integer in theme
100
+ * Set minimum required Ruby version to 1.9.3 instead of 1.9
101
+ * Use title capitalization for section titles in theming guide
102
+ * Update and reorganize keys in theming guide; document numerous keys previous missing
103
+ * Add hints to theming guide about how to apply styles when using Maven or Gradle (@fwilhe)
104
+ * Fix gemspec to collect files when project is not a git repository or git is not available
105
+
106
+ == 1.5.0.alpha.11 (2016-01-05) - @mojavelinux
107
+
108
+ * Allow font style for first line of abstract to be controlled by theme (@nawroth) (#378)
109
+ * Add option to make builds reproducible (@bk2204) (#338)
110
+ * Set default page size to A4 (@stephenhay) (#319)
111
+ * Preprocess all hex color values (#381)
112
+ * Add note about preprocessing hex color values to theming guide (#381)
113
+ * Honor base font style (#373)
114
+ * Don't fail to delete tmp file (#369)
115
+ * Lazy load icon fonts if detected (#364)
116
+ * Reduce heading line height in default theme (#351)
117
+ * Set default (fallback) SVG font from theme (#210)
118
+ * Expand last column to fit width of table (#372)
119
+ * Don't cache resolved imagesdir attribute value
120
+ * Use fallback when merging icon data
121
+ * Defer to built-in caching in prawn-icon
122
+ * Document replacements and numeric character refs in header/footer content
123
+ * Document base_font_size_min setting in theming guide
124
+ * Document that page background colors & images do not currently work in AsciidoctorJ PDF
125
+ * Use failproof relative require logic in bin script
126
+
127
+ {uri-repo}/issues?q=milestone%3Av1.5.0.alpha.11[issues resolved] |
128
+ {uri-repo}/releases/tag/v1.5.0.alpha.11[git tag]
129
+
130
+ == 1.5.0.alpha.10 (2015-11-01) - @mojavelinux
131
+
132
+ * Allow admonition icon to be customized by theme (#121) (@jessedoyle)
133
+ * Update to prawn-icon 1.0.0 (#335) (@jessedoyle)
134
+ * Only generate the pdfmarks file if the pdfmarks attribute is set
135
+ * Honor table alignment (via align attribute or role) (#299)
136
+ * Use Hash for ViewerPreferences; set initial magnification (#303)
137
+ * Handle case when colpcwidth is unspecified (#314)
138
+ * Show title for lists (olist, ulist, dlist) (#316)
139
+ * Don't attempt to add running content if document has no content pages
140
+ * Correctly calculate toc page range (#322)
141
+ * Don't insert blank page after back cover (#328)
142
+ * Document theme key that sets sidebar padding (#344)
143
+ * Handle case when CodeRay passes nil text to text_token
144
+
145
+ {uri-repo}/issues?q=milestone%3Av1.5.0.alpha.10[issues resolved] |
146
+ {uri-repo}/releases/tag/v1.5.0.alpha.10[git tag]
147
+
148
+ == 1.5.0.alpha.9 (2015-08-02) - @mojavelinux
149
+
150
+ * Apply point conversion to image widths (#221)
151
+ * Restore missing glyphs in Noto Serif font; adds support for Cyrillic languages (#72, #99)
152
+ * Add support for the Rouge source highlighter (#247)
153
+ * Fix parsing of style attribute in inline markup when it contains spaces; fixes Pygments highlighting
154
+ * Expand tabs to spaces in source document (#236)
155
+ * Scale down SVG if width is wider than page (#242)
156
+ * Load a base theme with defaults for required keys (#132)
157
+ * Enable PDF page import using block image macro (#177)
158
+ * Restore method in PDF::Core needed to import PDF page (#237)
159
+ * Restore text rendering mode after PDF import (#251)
160
+ * Support writing to STDOUT and other IO objects (#254)
161
+ * Enable pagenums by default; allow noheader & nofooter to control running header/footer (#205)
162
+ * Implement explicit table width, including autowidth (#258)
163
+ * Handle conversion to windows-1252 more gracefully when using built-in (AFM) fonts (#290)
164
+ * Disable warning if using a built-in (AFM) font
165
+ * Remove use of rhythm theme keys from converter (#289)
166
+ * Allow font_style to be set on literal text (#291)
167
+ * Parse inline image macro value of page_background_image (#222)
168
+ * Allow theme to control header cells in table body (#272)
169
+ * Make line height in running header/footer configurable (#274)
170
+ * Normalize text content in running header/footer (#266)
171
+ * Modify vertical alignment setting for running header/footer (#264)
172
+ * Use table background color, even if white; upgrade to Prawn Table 0.2.2 (#214)
173
+ * Delete trailing content page if empty (#147)
174
+ * Fix dry run calculation of block height...again (#215)
175
+ * Move footnotes to inline in a lighter shade
176
+ * Fix for JRuby 1.7 running in 2.0 mode
177
+ * Upgrade Prawn SVG to 0.21.0; fixes most badge SVGs
178
+ * Upgrade thread_safe gem
179
+ * Prevent crash if doc has no sections (@abatalev)
180
+
181
+ {uri-repo}/issues?q=milestone%3Av1.5.0.alpha.9[issues resolved] |
182
+ {uri-repo}/releases/tag/v1.5.0.alpha.9[git tag]
183
+
184
+ == 1.5.0.alpha.8 (2015-06-23) - @mojavelinux
185
+
186
+ * Support inline images (#9)
187
+ * Support link attribute on inline images (#209)
188
+ * Support inline icon macro (#97)
189
+ * Allow fine-grained control over image width (#76)
190
+ * Size conversion not yet applied to images on title page or in running header/footer
191
+ * Enable checklists (#181)
192
+ * Fix block height calculation when content is indented by propagating bounds to scratch document (#215)
193
+ * Don't insert page break before content whose height exceeds a single page (#183)
194
+ * Dash border of literal/listing block at page boundary when broken across pages (#190)
195
+ * Don't crash if toc entry is too long (#200)
196
+ * Add missing methods on OpenStruct to fix Rubinius compatibility (#81)
197
+ * Autofit font size in listing & literal blocks if autofit option is specified (#185)
198
+ * Support border style (e.g., double, dashed, dotted) (#196)
199
+ * Allow font color of outline list marker to be set by theme (#170)
200
+ * Allow use of hyphen in property names in the theme (#193)
201
+ * Only include table of contents if toc attribute is defined in header (#187)
202
+ * Improve parsing of pdf-page-size attribute
203
+ * Handle case in colist converter when previous block isn't found (#173)
204
+ * Print Asciidoctor PDF version in CLI output
205
+ * Upgrade Prawn (< 3.0.0, >= 1.3.0) (#68)
206
+ * Upgrade Prawn SVG to 0.20.0
207
+ * Document gem installation in README (#112)
208
+ * Perform code cleanups (#195)
209
+ * Silence warning about toc block macro
210
+ * Add -example suffix to example file names
211
+ * Use CodeRay as syntax highlighter in examples (#207)
212
+ * Use proper font names in default them to support custom fonts in SVGs
213
+ * Rework parser to parse void elements
214
+ * Apply first line formatting correctly (no dropped words)
215
+ * Add support for text-center role on paragraphs
216
+ * Update theming guide
217
+ * Fix cross references in README
218
+
219
+ {uri-repo}/issues?q=milestone%3Av1.5.0.alpha.8[issues resolved] |
220
+ {uri-repo}/releases/tag/v1.5.0.alpha.8[git tag]
221
+
222
+ == 1.5.0.alpha.7 (2015-05-31) - @mojavelinux
223
+
224
+ * Add support for font-based icons (Jesse Doyle) (#15)
225
+ * Enable font fallback support (Rei)
226
+ * Support single value for font_fallbacks key in theme
227
+ * Reenable M+ 1p as the fallback font
228
+ * Add option to specify the background color for even table rows (Tord Heimdal) (#104)
229
+ * Add block title for paragraphs (David Gamba) (#67)
230
+ * Allow custom page size setting (Otavio Salvador) (#84)
231
+ * Fix xref to sections (#56)
232
+ * Fix xrefs to non-section content (#110)
233
+ * Allow theme to control layout of title page (#135)
234
+ * Allow theme to control style of table of contents (#167)
235
+ * Allow running header & footer content to be customized (#89)
236
+ * Tighten spacing between list items, make value configurable (#92)
237
+ * Support CMYK color values (#155)
238
+ * Add support for measurement values in theme (#156)
239
+ * Name per-level heading theme keys consistently (e.g., heading_h<n>_font_size) (#157)
240
+ * Preprocess theme data to allow # in front of hex colors (#158)
241
+ * Support linkable images (#51)
242
+ * Render table footer row (#123)
243
+ * Don't crash if sectids attribute is disabled (#70)
244
+ * Support text transform in theme (uppercase / lowercase) (#138)
245
+ * Keep together shouldn't create blank pages (#150)
246
+ * Properly resolve image target as system path (#87)
247
+ * Show warning when image cannot be read (#148)
248
+ * Allow page background image to be specified (#134)
249
+ * Support PDF format as cover page (#113)
250
+ * Accomodate numbered list with large numbers (#91)
251
+ * Position list marker correctly (#140)
252
+ * Allow theme to set font size & family of table cells (#139)
253
+ * Unencode character entities in document title (#136)
254
+ * Process callouts in listing & literal blocks (#31)
255
+ * Use :center to vertically align table cell (#118)
256
+ * Normalize endlines in table cell text (#116)
257
+ * Support setting page size via attribute (#65)
258
+ * Remove unused fonts; update version of NotoSerif font license file
259
+ * Remove Asciidoctor theme until we're ready to fully implement
260
+ * Restore source highlighting when nested inside block
261
+ * Allow keys in theme to be nested to an arbitrary depth
262
+ * Assign width to border for blockquote if not specified in theme
263
+ * Add support for font family and style per heading level
264
+ * Implement basic converter for inline_indexterm
265
+ * Coerce negative values in theme if they slip through
266
+ * Use preserve_indentation in layout_prose
267
+ * Support remote images
268
+ * Add warning about unsupported gif format
269
+ * Abort cli if option parsing returns exit code
270
+ * Use SafeYAML to load theme files
271
+ * Handle transparent value for table background colors
272
+
273
+ {uri-repo}/issues?q=milestone%3Av1.5.0.alpha.7[issues resolved] |
274
+ {uri-repo}/releases/tag/v1.5.0.alpha.7[git tag]
275
+
276
+ == 1.5.0.alpha.6 (2014-11-28) - @mojavelinux
277
+
278
+ * Add pdf-fontsdir attributes to redefine fonts directory (andrey)
279
+ * Use require_relative to load Asciidoctor PDF in asciidoctor-pdf script (Ryan Bigg)
280
+ * Add example for specifying theme file (Leif Gruenwoldt) (#61)
281
+ * Add thread_safe gem to remove warning when registering converter
282
+
283
+ {uri-repo}/issues?q=milestone%3Av1.5.0.alpha.6[issues resolved] |
284
+ {uri-repo}/releases/tag/v1.5.0.alpha.6[git tag]
285
+
286
+ == 1.5.0.alpha.5 (2014-09-15) - @mojavelinux
287
+
288
+ * Allow chapter label to be controlled using the `chapter-label` attribute (#47)
289
+ * Prevent toc from overflowing content (#35)
290
+ * Fix page numbering for various permutations of front matter
291
+ * Don't activate implicit header include processor by default (#48, #25)
292
+ * Draw box around listings and literal blocks than span more than one page (#11)
293
+
294
+ {uri-repo}/issues?q=milestone%3Av1.5.0.alpha.5[issues resolved] |
295
+ {uri-repo}/releases/tag/v1.5.0.alpha.5[git tag]
296
+
297
+ == 1.5.0.alpha.4 (2014-09-09) - @mojavelinux
298
+
299
+ * Fix yield statement so Asciidoctor PDF can be used with JRuby
300
+ * Document that the coderay gem must be installed to run the examples (#42)
301
+
302
+ {uri-repo}/issues?q=milestone%3Av1.5.0.alpha.4[issues resolved] |
303
+ {uri-repo}/releases/tag/v1.5.0.alpha.4[git tag]
304
+
305
+ == 1.5.0.alpha.3 (2014-09-08) - @mojavelinux
306
+
307
+ * Remove unnecessary dependencies (tilt, slim, thread_safe)
308
+
309
+ {uri-repo}/issues?q=milestone%3Av1.5.0.alpha.3[issues resolved] |
310
+ {uri-repo}/releases/tag/v1.5.0.alpha.3[git tag]
311
+
312
+ == 1.5.0.alpha.2 (2014-09-05) - @mojavelinux
313
+
314
+ * Add magic encoding header to source file so Asciidoctor PDF can be used with Ruby 1.9.3 (#33, #36)
315
+
316
+ {uri-repo}/issues?q=milestone%3Av1.5.0.alpha.2[issues resolved] |
317
+ {uri-repo}/releases/tag/v1.5.0.alpha.2[git tag]
318
+
319
+ == 1.5.0.alpha.1 (2014-09-04) - @mojavelinux
320
+
321
+ * Rewrite as proper Asciidoctor converter (#29)
322
+ * Initial pre-release
323
+
324
+ {uri-repo}/issues?q=milestone%3Av1.5.0.alpha.1[issues resolved] |
325
+ {uri-repo}/releases/tag/v1.5.0.alpha.1[git tag]
data/Gemfile CHANGED
@@ -6,5 +6,5 @@ gem 'prawn', '1.3.0' if (Gem::Version.new RUBY_VERSION) < (Gem::Version.new '2.0
6
6
  gemspec
7
7
 
8
8
  group :examples do
9
- gem 'rouge', '2.0.5'
9
+ gem 'rouge', '2.0.6'
10
10
  end
@@ -1,29 +1,42 @@
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.alpha.12, 2016-08-05
3
+ v1.5.0.alpha.13, 2016-09-19
4
4
  // Settings:
5
- :compat-mode!:
6
5
  :experimental:
7
6
  :idprefix:
8
7
  :idseparator: -
9
- :icons: font
10
- ifdef::env-github,env-browser[:outfilesuffix: .adoc]
11
- :pagenums:
12
- //:pdf-page-size: [8.25in, 11.69in]
13
- //:pdf-page-size: A4
14
- ifdef::env-browser[:toc: preamble]
8
+ ifndef::env-github[:icons: font]
9
+ ifdef::env-github,env-browser[]
10
+ :toc: macro
11
+ :toclevels: 1
12
+ endif::[]
13
+ ifdef::env-github[]
14
+ :status:
15
+ :outfilesuffix: .adoc
16
+ :!toc-title:
17
+ :caution-caption: :fire:
18
+ :important-caption: :exclamation:
19
+ :note-caption: :paperclip:
20
+ :tip-caption: :bulb:
21
+ :warning-caption: :warning:
22
+ endif::[]
15
23
  // Aliases:
16
24
  :project-name: Asciidoctor PDF
17
25
  :project-handle: asciidoctor-pdf
18
26
  // URIs:
19
- //ifdef::env-github[:relfileprefix: /blob/master/]
27
+ :uri-asciidoctor: http://asciidoctor.org
28
+ :uri-gem: http://rubygems.org/gems/asciidoctor-pdf
20
29
  :uri-project: https://github.com/asciidoctor/asciidoctor-pdf
21
30
  :uri-project-repo: {uri-project}
22
31
  :uri-project-issues: {uri-project-repo}/issues
23
32
  :uri-project-list: http://discuss.asciidoctor.org
24
33
  :uri-prawn: http://prawn.majesticseacreature.com
25
34
  :uri-rvm: http://rvm.io
26
- :uri-asciidoctor: http://asciidoctor.org
35
+
36
+ ifdef::status[]
37
+ image:https://img.shields.io/gem/v/asciidoctor-pdf.svg[Latest Release, link={uri-gem}]
38
+ image:https://img.shields.io/badge/license-MIT-blue.svg[MIT License, link=#copyright]
39
+ endif::[]
27
40
 
28
41
  _Lo and behold_, a native PDF converter for AsciiDoc built with {uri-asciidoctor}[Asciidoctor] and {uri-prawn}[Prawn]! +
29
42
  _No more middleman._ +
@@ -35,7 +48,9 @@ CAUTION: {project-name} is currently _alpha_ software.
35
48
  While the converter handles most AsciiDoc content, there's still work needed to fill in gaps where conversion is incomplete, incorrect or not implemented.
36
49
  See the milestone v1.5.0 in the {uri-project-issues}[issue tracker] for details.
37
50
 
38
- == Prawn, the majestic PDF generator
51
+ toc::[]
52
+
53
+ == Prawn, the Majestic PDF Generator
39
54
 
40
55
  {uri-project}[{project-name}] is made possible by an amazing Ruby gem named Prawn.
41
56
  And what a gem it is!
@@ -68,31 +83,33 @@ Picking up from there, {project-name} takes the pain out of creating PDF documen
68
83
 
69
84
  == Features
70
85
 
71
- === Notable features
86
+ === Notable Features
72
87
 
73
88
  * Direct AsciiDoc to PDF conversion
74
89
  * <<docs/theming-guide.adoc#,Configuration-driven style and layout>>
90
+ * SVG support
75
91
  * PDF document outline (i.e., bookmarks)
76
92
  * Table of contents page(s)
77
93
  * Document metadata (title, authors, subject, keywords, etc)
78
94
  * Internal cross reference links
79
- * Syntax highlighting with CodeRay or Pygments
95
+ * Syntax highlighting with Rouge, Pygments, or CodeRay
80
96
  * Page numbering
81
97
  * Customizable running content (header and footer)
82
98
  * “Keep together” blocks (i.e., page breaks avoided in certain block content)
99
+ * Orphaned section titles avoided
83
100
  * Autofit verbatim blocks (as permitted by base_font_size_min setting)
84
- * Orphan section titles avoided
85
101
  * Table border settings honored
86
102
  * Font-based icons
87
- * Custom fonts
103
+ * Custom (TTF) fonts
104
+ * Double-sided printing mode (margins alternate on recto and verso pages)
88
105
 
89
- === Missing features
106
+ === Missing Features
90
107
 
91
108
  See <<WORKLOG.adoc#,WORKLOG>>.
92
109
 
93
110
  == Prerequisites
94
111
 
95
- All that's needed is Ruby (1.9.3 or above; 2.2.x recommended) and a few Ruby gems, which we explain how to install in the next section.
112
+ All that's needed is Ruby (1.9.3 or above; 2.3.x recommended) and a few Ruby gems, which we explain how to install in the next section.
96
113
 
97
114
  To check if you have Ruby available, use the `ruby` command to query the version installed:
98
115
 
@@ -100,15 +117,17 @@ To check if you have Ruby available, use the `ruby` command to query the version
100
117
 
101
118
  [WARNING]
102
119
  ====
103
- Prawn 2.0.0 and above requires Ruby >= 2.0.0 at installation (though it still works with Ruby 1.9.3 once you get beyond installation).
104
- If you need to use Asciidoctor PDF with Ruby 1.9.3, you must first install Prawn 1.3.0 using:
120
+ By default, Asciidoctor PDF selects the latest version of Prawn to install.
121
+ Since version 2.0.0, Prawn requires Ruby >= 2.0.0 during installation (though it may still work with Ruby 1.9.3 if you get past installation).
122
+ Therefore, to use Asciidoctor PDF with Ruby 1.9.3, you must first explicitly install Prawn 1.3.0 and Prawn SVG 0.21.0 using the following commands:
105
123
 
106
124
  $ gem install prawn --version 1.3.0
125
+ gem install prawn-svg --version 0.21.0
107
126
 
108
- You can then proceed with installation of Asciidoctor PDF.
127
+ You can then proceed with installation of Asciidoctor PDF on Ruby 1.9.3.
109
128
  ====
110
129
 
111
- === System encoding
130
+ === System Encoding
112
131
 
113
132
  Asciidoctor assumes you're using UTF-8 encoding.
114
133
  To minimize encoding problems, make sure the default encoding of your system is set to UTF-8.
@@ -121,11 +140,11 @@ To solve these problems, we recommend at least changing the active code page in
121
140
 
122
141
  Once you make this change, all your Unicode headaches will be behind you.
123
142
 
124
- == Getting started
143
+ == Getting Started
125
144
 
126
145
  You can get {project-name} by <<install-the-published-gem,installing the published gem>> or <<development,running the code from source>>.
127
146
 
128
- === Install the published gem
147
+ === Install the Published Gem
129
148
 
130
149
  {project-name} is published as a pre-release on RubyGems.org.
131
150
  You can install the published gem using the following command:
@@ -159,7 +178,7 @@ If you see the version of {project-name} printed, you're ready to use {project-n
159
178
 
160
179
  Let's grab an AsciiDoc document to distill and start putting {project-name} to use!
161
180
 
162
- === An example AsciiDoc document
181
+ === An Example AsciiDoc Document
163
182
 
164
183
  If you don't already have an AsciiDoc document, you can use the [file]_basic-example.adoc_ file found in the examples directory of this project.
165
184
 
@@ -207,7 +226,7 @@ The layout and styling of the PDF is driven by a YAML configuration file.
207
226
  To learn how the theming system works and how to create and apply custom themes, refer to the <<docs/theming-guide.adoc#,Asciidoctor PDF Theme Guide>>.
208
227
  You can use the built-in theme files, which you can find in the [file]_data/themes_ directory, as examples.
209
228
 
210
- == Font-based icons
229
+ == Font-Based Icons
211
230
 
212
231
  You can use icons in your PDF document using any of the following icon sets:
213
232
 
@@ -259,10 +278,20 @@ You can enable use of fonts during PDF generation (instead of in the document he
259
278
  Icon-based fonts are handled by the `prawn-icon` gem.
260
279
  To find a complete list of available icons, consult the https://github.com/jessedoyle/prawn-icon/tree/master/data/fonts[prawn-icon] repository.
261
280
 
262
- == Image scaling
281
+ == Image Paths
282
+
283
+ Images are resolved relative to the value of the `imagesdir` attribute at the time the converter is run.
284
+ This is effectively the same as how the built-in HTML converter works when the `data-uri` attribute is set.
285
+ The `imagesdir` is blank by default, which means images are resolved relative to the input document.
286
+
287
+ If the image is an SVG, and the SVG includes a nested raster image (png or jpg) with a relative path, that path is resolved relative to the directory that contains the SVG.
263
288
 
264
- Since PDF is a fixed-width canvas, you almost always need to specify an image width to get the image to fit properly on the page.
265
- There are four ways to specify the width of the image, listed here in order of precedence:
289
+ The converter will refuse to include an image if the target is a URI unless the `allow-uri-read` attribute is enabled via the CLI or API.
290
+
291
+ == Image Scaling
292
+
293
+ Since PDF is a fixed-width canvas, you almost always need to specify a width to get the image to fit properly on the page.
294
+ There are five ways to specify the width of an image, listed here in order of precedence:
266
295
 
267
296
  [cols="1s,3d"]
268
297
  |===
@@ -276,19 +305,23 @@ _Intended to be used for the PDF converter only._
276
305
  |The display width of the image as a percentage of the content width (e.g., 75%).
277
306
  _Intended to be used for print output such as PDF._
278
307
 
308
+ |image_width key from theme
309
+ |Accepts the same values as pdfwidth.
310
+ _Only applies to block images._
311
+
279
312
  |width
280
313
  |The unitless display width of the image (assumed to be pixels), typically matching the intrinsic width of the image.
281
314
  If the width exceeds the content width, the image is scaled down to the content width.
282
315
 
283
316
  |_unspecified_
284
- |If you don't specify one of the width attributes, the intrinsic width of the image is used (the px value is multiplied by 75% to convert to pt) unless the width exceeds the content width, in which case the image is scaled down to the content width.
317
+ |If you don't specify one of the aforementioned width settings, the intrinsic width of the image is used (the px value is multiplied by 75% to convert to pt) unless the width exceeds the content width, in which case the image is scaled down to the content width.
285
318
  |===
286
319
 
287
- The sizing is always controlled by the width (explicit or intrinsic) and the size of the image is scaled proporationally.
288
- The height of the image is ignored by the PDF converter, with one exception.
289
- If the height of the image exceeds the height of the page, the image is scaled down to fit on a single page.
320
+ The image is always sized according to the explicit or intrinsic width and its height is scaled proporationally.
321
+ The height of the image is ignored by the PDF converter unless the height of the image exceeds the content height of the page.
322
+ In this case, the image is scaled down to fit on a single page.
290
323
 
291
- === pdfwidth attribute
324
+ === Using the pdfwidth Attribute
292
325
 
293
326
  The pdfwidth attribute is the recommended way to set the image size for the PDF output.
294
327
  This attribute is provided for two reasons.
@@ -307,7 +340,32 @@ The pdfwidth attribute supports the following units:
307
340
 
308
341
  In all cases, the width is converted to pt.
309
342
 
310
- == Optional scripts
343
+ === Specifying a default pdfwidth
344
+
345
+ If you want to scale all block images that don't have a pdfwidth (or scaledwidth) attribute the same, assign a value to the image_width key in your theme.
346
+
347
+ [source,yaml]
348
+ ----
349
+ image:
350
+ width: 100%
351
+ ----
352
+
353
+ === Inline Image Sizing
354
+
355
+ Inline images are handled different than block images.
356
+ In particular, inline images do not support sizing using the pdfwidth attribute.
357
+
358
+ Here's how an inline image is sized.
359
+ The image height is scaled down to 75% of the specified width (px to pt conversion).
360
+ If the image height is more than 1.5x the height of the surrounding line of text, the font size and line metrics of the fragment are modified to fit the image in the line.
361
+
362
+ == Printing
363
+
364
+ To print a range of pages as labeled in the document, you need to add the number of front matter pages (the pages labeled with a roman numeral) to the printed page number(s).
365
+ The print dialog doesn't understand the page numbers labels.
366
+ Instead, it only considers the physical pages.
367
+
368
+ == Optional Scripts
311
369
 
312
370
  {project-name} also provides a shell script that invokes GhostScript (`gs`) to optimize and compress the generated PDF with minimal impact on quality.
313
371
  You must have Ghostscript installed to use it.
@@ -342,14 +400,14 @@ Feel free to use the {uri-project-issues}[issue tracker] or {uri-project-list}[A
342
400
  To help develop {project-name}, or to simply use the development version, you need to get the source from GitHub.
343
401
  Follow the instructions below to learn how to clone the source and run it from your local copy.
344
402
 
345
- === Retrieve the source code
403
+ === Retrieve the Source Code
346
404
 
347
405
  You can retrieve the source of {project-name} in one of two ways:
348
406
 
349
407
  . Clone the git repository
350
408
  . Download a zip archive of the repository
351
409
 
352
- ==== Option 1: Fetch using git clone
410
+ ==== Option 1: Fetch Using Git
353
411
 
354
412
  If you want to clone the git repository, simply copy the {uri-project-repo}[GitHub repository URL] and pass it to the `git clone` command:
355
413
 
@@ -359,7 +417,7 @@ Next, change to the project directory:
359
417
 
360
418
  $ cd asciidoctor-pdf
361
419
 
362
- ==== Option 2: Download the archive
420
+ ==== Option 2: Download the Archive
363
421
 
364
422
  If you want to download a zip archive, click the btn:[Download Zip] button on the right-hand side of the repository page on GitHub.
365
423
  Once the download finishes, extract the archive, open a console and change to that directory.
@@ -368,11 +426,11 @@ TIP: Instead of working out of the {project-handle} directory, you can simply ad
368
426
 
369
427
  We'll leverage the project configuration to install the necessary dependencies.
370
428
 
371
- === Install dependencies
429
+ === Install Dependencies
372
430
 
373
431
  If you're using {uri-rvm}[RVM], we recommend creating a new gemset to work with {project-name}:
374
432
 
375
- $ rvm use 2.2@asciidoctor-pdf --create
433
+ $ rvm use 2.3@asciidoctor-pdf --create
376
434
 
377
435
  We like RVM because it keeps the dependencies required by various projects isolated.
378
436
 
@@ -395,10 +453,6 @@ NOTE: You need to call `bundle` from the project directory so that it can find t
395
453
 
396
454
  Assuming all the required gems install properly, verify you can run the `asciidoctor-pdf` script using Ruby:
397
455
 
398
- $ ruby ./bin/asciidoctor-pdf -v
399
-
400
- or
401
-
402
456
  $ bundle exec ./bin/asciidoctor-pdf -v
403
457
 
404
458
  If you see the version of {project-name} printed, you're ready to use {project-name}!