asciidoctor-pdf 1.5.0.beta.6 → 1.5.0.beta.7

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: fa4efe2963835f293701e1e831c7fc5cafce4c1922362b063e8265bd133e29a1
4
- data.tar.gz: '08ff1cbea70552786797786465cfab1c626506287dbd8e56ae0204da000c5807'
3
+ metadata.gz: 4d563652f77af3a20dcc19c756b55981f7a0efaea638a4678087ca95f12a3048
4
+ data.tar.gz: e335e4b4ad2487ced3f7ab927bbdb8711aa64405987365b41fc7f6695a19a5ac
5
5
  SHA512:
6
- metadata.gz: 16733468d925e9e30158073fd0859498c2c70fd9c8f3ede9e49ab57eda7391dbde5eda608dead1fcf01db5414a4d46f5f0e486470f45f467b263cf11fdd95ded
7
- data.tar.gz: ed4a9a710c1bf31940265451e4bafb312c1fb4ca4d75a2ab69e89948f6e2975c1410a9335edef5e1fd0ce4bb7bb286b4612149d5d01c52014d571143f4d807f4
6
+ metadata.gz: c0129884c47560e43eb28149451c618160bfcafe68112fb3d247ec67bae13a3f47130cd65dac9b140c2f20e3eaef8d96661b749afea7a1bed2054cdf7c16b8a4
7
+ data.tar.gz: 7ece71b33af340fac13ffa6e78187e86c25c38f7f0d472a02aaaea8c8cffda5bf5ccd560f4a5a2e914eaaa1dd9730bf4cfef0d9e931b4b60305b6fc065eff429
data/CHANGELOG.adoc CHANGED
@@ -5,6 +5,28 @@
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.0.beta.7 (2019-10-29) - @mojavelinux
9
+
10
+ * fix value of implicit page-count attribute when page numbering and running content don't start on same page (#1334)
11
+ * fix value of implicit chapter-title attribute on preface pages (#1340)
12
+ * show value of untitled-label attribute in outline if doctitle is not set (#1348)
13
+ * don't show entry for doctitle in outline if doctitle is not set and untitled-label attribute is unset (#1348)
14
+ * generate outline if document has doctitle but no body (#1349)
15
+ * allow elements on title page to be disabled from theme using display: none (#1346)
16
+ * set chapter-title attribute to value of toc-title attribute on toc pages in book (#1338)
17
+ * set section-title attribute to value of toc-title attribute on toc pages in article if page has no other sections (#1338)
18
+ * allow ranges of pages from PDF file to be imported using image macro as specified by pages attribute (#1300)
19
+ * set default footer content in base theme; remove logic to process `footer_<side>_content: none` key (#1320)
20
+ * include doctitle in outline for article when article is only a single page (#1322)
21
+ * allow custom (inline) role to control text decoration property (#1326)
22
+ * point doctitle entry in outline to first page of content when doctype is article and document has front cover
23
+ * fix asciidoctor-pdf-optimize script and register it as a bin script
24
+ * rename `-q` CLI option of asciidoctor-pdf-optimize script to `--quality`
25
+ * only promote first paragraph of preamble to lead paragraph (assuming it has no role) (#1332)
26
+ * don't promote first paragraph of preamble to lead paragraph if it already has a role (#1332)
27
+ * fix crash when document has no doctitle or sections and untitled-label attribute is unset
28
+ * ignore invalid align value for title logo image (#1352)
29
+
8
30
  == 1.5.0.beta.6 (2019-10-11) - @mojavelinux
9
31
 
10
32
  * reorganize source files under asciidoctor/pdf folder (instead of asciidoctor-pdf)
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
- v1.5.0.beta.6, 2019-10-12
3
+ v1.5.0.beta.7, 2019-10-29
4
4
  // Settings:
5
5
  :experimental:
6
6
  :idprefix:
@@ -24,7 +24,7 @@ endif::[]
24
24
  :project-name: Asciidoctor PDF
25
25
  :project-handle: asciidoctor-pdf
26
26
  // Variables:
27
- :release-version: 1.5.0.beta.6
27
+ :release-version: 1.5.0.beta.7
28
28
  // URIs:
29
29
  :url-asciidoctor: http://asciidoctor.org
30
30
  :url-gem: http://rubygems.org/gems/asciidoctor-pdf
@@ -203,6 +203,38 @@ You then activate syntax highlighting for a given document by adding the `source
203
203
  :source-highlighter: rouge
204
204
  ----
205
205
 
206
+ ==== Upgrade Prawn and Extensions (optional)
207
+
208
+ {project-name} uses Prawn to handle the PDF generation, which has a different release cycle.
209
+ At times, there may are development features in Prawn and its extensions you need to use which haven't yet been released.
210
+ No problem.
211
+ You can still gain access to these features by installing the unreleased gems directly from GitHub.
212
+
213
+ To get started, first create a [.path]_Gemfile_ in the root of your project.
214
+ In that file, declare the gem soruce, the {project-handle} gem, and the prawn gem and/or one of its extension gems.
215
+ In this example, we'll install both the prawn and prawn-table gems from GitHub.
216
+
217
+ .Gemfile
218
+ [source,ruby]
219
+ ----
220
+ source 'https://rubygems.org'
221
+
222
+ gem 'asciidoctor-pdf'
223
+ gem 'prawn', github: 'prawnpdf/prawn'
224
+ gem 'prawn-table', github: 'prawnpdf/prawn-table'
225
+ ----
226
+
227
+ You can then install the gems into your project using the `bundle` command:
228
+
229
+ $ bundle --path=.bundle/gems
230
+
231
+ Since you are using Bundler to manage the gems, you'll need to prefix all commands with `bundle exec`.
232
+ For example:
233
+
234
+ $ bundle exec asciidoctor-pdf -v
235
+
236
+ Thus, to any command present in the following sections, be sure to include this prefix.
237
+
206
238
  === Run the Application
207
239
 
208
240
  Assuming all the required gems install properly, verify you can run the `asciidoctor-pdf` script:
@@ -616,25 +648,36 @@ To import the first page from a PDF file, use the block image macro with the PDF
616
648
  image::custom-page.pdf[]
617
649
  ----
618
650
 
651
+ The converter will insert the page from the PDF as a dedicated page that matches the size and layout of the page being imported (no matter where the block image occurs).
652
+ Therefore, there's no need to put a manual page break (i.e., `<<<`) around the image macro.
653
+
619
654
  By default, this macro will import the first page of the PDF.
620
655
  To import a different page, specify it as a 1-based index using the `page` attribute.
621
656
 
622
657
  [source,asciidoc]
623
658
  ----
624
- image::custom-page.pdf[page=2]
659
+ image::custom-pages.pdf[page=2]
625
660
  ----
626
661
 
627
- To import multiple pages, you'll need to use multiple image macros, each specifying the page number to import.
662
+ You can import multiple pages either using multiple image macros or using the `pages` attribute.
663
+ The `pages` attribute accepts individual page numbers or page number ranges (two page numbers separated by `..`).
664
+ The values can be separated either by commas or semi-colons.
665
+ (The syntax is similar to the syntax uses for the `lines` attribute of the AsciiDoc include directive).
628
666
 
629
- CAUTION: An image macro that imports a PDF page should never be nested inside a delimited block or table.
630
- It should be a direct descendant of the document or a section.
631
- Otherwise, the behavior is unspecified.
667
+ [source,asciidoc]
668
+ ----
669
+ image::custom-pages.pdf[pages=3;1..2]
670
+ ----
632
671
 
633
- The converter will insert the page from the PDF as a dedicated page that matches the size and layout of the page being imported (no matter where the block image occurs).
634
- Therefore, there's no need to put a manual page break (i.e., `<<<`) around the image macro.
672
+ Pages are imported in the order listed.
635
673
 
636
674
  To see a practical example of how to use this feature, refer to the blog post https://fromplantoprototype.com/blog/2019/08/07/importing-pdf-pages-in-asciidoctor-pdf/[Importing PDF Pages in asciidoctor-pdf].
637
675
 
676
+ CAUTION: An image macro used to imports PDF pages should never be nested inside a delimited block or table cell.
677
+ It should be a direct descendant of the document or a section.
678
+ That's because what it imports are entire pages.
679
+ If it's used inside a delimited block or table cell, the behavior is unspecified.
680
+
638
681
  == Crafting Interdocument Xrefs
639
682
 
640
683
  This converter produces a single PDF file, which means content from multiple source documents get colocated into the same output file.
@@ -917,7 +960,8 @@ That's why {project-name} always creates this file in addition to the PDF.
917
960
  IMPORTANT: The `asciidoctor-pdf-optimize` is not guaranteed to reduce the size of the PDF file.
918
961
  It may actually make the PDF larger.
919
962
  You should probably only consider using it if the file size of the original PDF is several megabytes.
920
- You can also try reducing the quality of the output file using the `-q` flag (e.g., `-q screen`).
963
+ You can also try reducing the quality of the output file using the `--quality` flag (e.g., `--quality screen`).
964
+ The `--quality` flag accepts the following keywords: `default` (default), `screen`, `ebook`, `printer`, and `prepress`.
921
965
 
922
966
  === hexapdf
923
967
 
@@ -989,11 +1033,9 @@ We'll leverage the project configuration to install the necessary dependencies.
989
1033
 
990
1034
  === Install Dependencies
991
1035
 
992
- If you're using {url-rvm}[RVM], we recommend creating a new gemset to work with {project-name}:
1036
+ We recommend using {url-rvm}[RVM] to manage the installation of Ruby you'll use to build and develop the project.
993
1037
 
994
- $ rvm use 2.5@asciidoctor-pdf --create
995
-
996
- We like RVM because it keeps the dependencies required by various projects isolated.
1038
+ $ rvm use 2.6
997
1039
 
998
1040
  The dependencies needed to use {project-name} are defined in the [.path]_Gemfile_ at the root of the project.
999
1041
  We can use Bundler to install the dependencies for us.
@@ -1006,11 +1048,11 @@ If it's not installed, use the `gem` command to install it.
1006
1048
 
1007
1049
  $ gem install bundler
1008
1050
 
1009
- Then use the `bundle` command to install the project dependencies:
1051
+ Then use the `bundle` command with the `--path` option to install the project dependencies into the project:
1010
1052
 
1011
- $ bundle
1053
+ $ bundle --path=.bundle/gems
1012
1054
 
1013
- NOTE: You need to call `bundle` from the project directory so that it can find the [.path]_Gemfile_.
1055
+ NOTE: You must call `bundle` from the project directory so that it can find the [.path]_Gemfile_.
1014
1056
 
1015
1057
  === Run the Tests
1016
1058
 
@@ -1021,11 +1063,11 @@ To run the tests, simply invoke rspec via bundler.
1021
1063
 
1022
1064
  To disable the visual integration tests, pass the `` option:
1023
1065
 
1024
- $ bundle exec rspec -t ~integration
1066
+ $ bundle exec rspec -t ~visual
1025
1067
 
1026
1068
  If a visual integration test fails, you can instruct the test suite to keep the files in the [.path]_spec/output_ directory by setting the `DEBUG` environment variable:
1027
1069
 
1028
- $ DEBUG=true bundle exec rspec -t integration
1070
+ $ DEBUG=true bundle exec rspec -t visual
1029
1071
 
1030
1072
  If you want to see the name of each test as it is run, add the `-fd` option:
1031
1073
 
@@ -1146,6 +1188,23 @@ You'll see a total coverage score, a detailed coverage report, and a link to HTM
1146
1188
  The HTML report helps you understand which lines and branches were missed, if any.
1147
1189
  ////
1148
1190
 
1191
+ === Rebuild the Formatter Text Parser
1192
+
1193
+ The formatted text is first converted to a pseudo-HTML language, then converted from there into Prawn text fragments using a https://github.com/cjheath/treetop[treetop] parser.
1194
+ treetop is a Ruby-based parsing DSL based on parsing expression grammars.
1195
+ This strategy allows the converter to manipulate the formatted text without needing the know the internal details of how Prawn arranges text fragments.
1196
+ It also allows Asciidoctor to behave in a consistent manner, since some of the inline parsing in Asciidoctor assumes that the converter is generating an SGML-based language like HTML or DocBook.
1197
+
1198
+ The parsing expression grammar is defined in the source file [.path]_lib/asciidoctor/pdf/formatted_text/parser.treetop_.
1199
+ If you make a change to this file, you must regenerate the parser, which is defined in the source file _lib/asciidoctor/pdf/formatted_text/parser.rb_.
1200
+ (Don't modify the generated parser directly).
1201
+
1202
+ Use the following command to regenerate the parser:
1203
+
1204
+ bundle exec tt lib/asciidoctor/pdf/formatted_text/parser.treetop
1205
+
1206
+ You then need to commit both files.
1207
+
1149
1208
  [[resources,Links]]
1150
1209
  == Resources
1151
1210
 
@@ -30,7 +30,6 @@ Gem::Specification.new do |s|
30
30
  end
31
31
  s.files = files.grep %r/^(?:(?:data|lib)\/.+|docs\/theming-guide\.adoc|(?:CHANGELOG|LICENSE|NOTICE|README)\.adoc|\.yardopts|#{s.name}\.gemspec)$/
32
32
  s.executables = (files.grep %r/^bin\//).map {|f| File.basename f }
33
- s.executables = ['asciidoctor-pdf']
34
33
  s.require_paths = ['lib']
35
34
  #s.test_files = files.grep %r/^(?:test|spec|feature)\/.*$/
36
35
 
@@ -0,0 +1,20 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ optimizer = File.absolute_path '../lib/asciidoctor/pdf/optimizer.rb', __dir__
5
+ if File.exist? optimizer
6
+ require optimizer
7
+ else
8
+ require 'asciidoctor-pdf/optimizer'
9
+ end
10
+
11
+ args = ARGV.dup
12
+
13
+ unless (filename = args.pop)
14
+ warn 'asciidoctor-pdf-optimize: Please specify a PDF file to optimize.'
15
+ exit 1
16
+ end
17
+
18
+ quality = args[0] == '--quality' ? args[1].to_s : ''
19
+
20
+ (Asciidoctor::PDF::Optimizer.new quality).generate_file filename
@@ -114,3 +114,5 @@ toc_indent: 15
114
114
  toc_line_height: 1.4
115
115
  footnotes_font_size: 9
116
116
  footnotes_item_space: 3
117
+ footer_recto_right_content: '{page-number}'
118
+ footer_verso_left_content: '{page-number}'
@@ -3,7 +3,7 @@ Dan Allen <https://github.com/mojavelinux[@mojavelinux]>
3
3
  // Settings:
4
4
  :idprefix:
5
5
  :idseparator: -
6
- :toc: preamble
6
+ :toc: macro
7
7
  :experimental:
8
8
  ifndef::env-github[:icons: font]
9
9
  ifdef::env-github[]
@@ -845,8 +845,11 @@ This will allow you to use the same font names (aka families) in both your graph
845
845
  === Fallback Fonts
846
846
 
847
847
  If a TrueType font is missing a character needed to render the document, such as a special symbol, you can have Asciidoctor PDF look for the character in a fallback font.
848
+
848
849
  You only need to specify a single fallback font, typically one that provides a full set of symbols.
849
- If the character isn't found in the fallback font, it will mostly likely be replaced by a box (guaranteed if you're using the bundled fallback font).
850
+ If the character isn't found in the fallback font, it will mostly likely be replaced by a box (which is guaranteed if you're using the bundled fallback font).
851
+
852
+ IMPORTANT: When defining the fallback font, you *must specify all four variants* (normal, bold, italic, bold_italic), even if you use the same font file for each.
850
853
 
851
854
  IMPORTANT: The fallback font only gets used when the primary font is a TrueType font (i.e., TTF, DFont, TTC).
852
855
  Any glyph missing from an AFM font is simply replaced with the "`not`" glyph (`&#172;`).
@@ -877,6 +880,9 @@ font:
877
880
  bold_italic: droid-sans-fallback.ttf
878
881
  ----
879
882
 
883
+ Notice that we define all four variants for the fallback font, even though we're use the same font file for each variant.
884
+ This ensures the fallback font will be used regardless of which font style is active when it gets called on.
885
+
880
886
  Next, add the key name to the `fallbacks` key under the `font-catalog` key.
881
887
  The `fallbacks` key accepts an array of values, meaning you can specify more than one fallback font.
882
888
  However, we recommend using a single fallback font, if possible, as shown here:
@@ -1156,7 +1162,7 @@ See <<Title Page>> for details.
1156
1162
  |page:
1157
1163
  size: Letter
1158
1164
 
1159
- |numbering-start-at
1165
+ |numbering-start-at^[5]^
1160
1166
  |title {vbar} toc {vbar} body +
1161
1167
  (default: body)
1162
1168
  |page:
@@ -1174,6 +1180,8 @@ To disable the image, use the value `none`.
1174
1180
  . Target may be an absolute path or a path relative to the value of the `pdf-themesdir` attribute.
1175
1181
  . The margins for `recto` (right-hand, odd-numbered) and `verso` (left-hand, even-numbered) pages are calculated automatically from the margin-inner and margin-outer values.
1176
1182
  These margins and used when the value `prepress` is assigned to the `media` document attribute.
1183
+ . The `toc` value only applies if the toc is in the default location (before the first page of the body).
1184
+ If the toc macro is used to position the toc, the start-at behavior is the same as if the toc is not enabled.
1177
1185
 
1178
1186
  [#keys-base]
1179
1187
  === Base
@@ -1412,6 +1420,7 @@ The keys in this category are used for inline monospaced text in prose and table
1412
1420
  |literal:
1413
1421
  font-style: bold
1414
1422
  |===
1423
+
1415
1424
  . The border is only used if a border color is specified and the border width is not explicitly set to 0.
1416
1425
  The border only works properly if the literal phrase does not have nested formatting.
1417
1426
  Otherwise, the border will be inherited, producing a less than desirable result.
@@ -1590,11 +1599,13 @@ The keys in this category control the style of a section body.
1590
1599
  3+|[#key-prefix-section]*Key Prefix:* <<key-prefix-section,section>>
1591
1600
 
1592
1601
  |indent
1593
- |<<measurement-units,Measurement>> +
1602
+ |<<measurement-units,Measurement>> {vbar} <<measurement-units,Measurement[left,right]>>^[1]^ +
1594
1603
  (default: 0)
1595
1604
  |section:
1596
- indent: 36
1605
+ indent: [0.5in, 0]
1597
1606
  |===
1607
+ . A single value gets applied to both the left and right side (e.g., `0.5in`).
1608
+ A two-value array configures the left and right side independently (e.g., `[0.5in, 0]`).
1598
1609
 
1599
1610
  [#keys-title-page]
1600
1611
  === Title Page
@@ -1604,6 +1615,8 @@ The keys in this category control the style of the title page as well as the arr
1604
1615
  IMPORTANT: The title page is only enabled by default for the book doctype (e.g., `:doctype: book`).
1605
1616
  If you want to enable the title page when using a different doctype (such as the article doctype), you must define the `title-page` attribute in the document header (i.e., `:title-page:`).
1606
1617
 
1618
+ NOTE: Subtitle partitioning of the doctitle is only enabled when the title page is also enabled.
1619
+
1607
1620
  TIP: The title page can be disabled for the book doctype by setting the `notitle` attribute in the AsciiDoc document header (i.e., `:notitle:`).
1608
1621
  (For other doctypes, just don't set the `title-page` attribute).
1609
1622
 
@@ -1692,6 +1705,13 @@ TIP: The title page can be disabled for the book doctype by setting the `notitle
1692
1705
 
1693
1706
  3+|[#key-prefix-title-page-title]*Key Prefix:* <<key-prefix-title-page-title,title-page-title>>
1694
1707
 
1708
+ |display
1709
+ |none +
1710
+ (default: _not set_)
1711
+ |title-page:
1712
+ title:
1713
+ display: none
1714
+
1695
1715
  |font-color
1696
1716
  |<<colors,Color>> +
1697
1717
  (default: _inherit_)
@@ -1757,6 +1777,13 @@ TIP: The title page can be disabled for the book doctype by setting the `notitle
1757
1777
 
1758
1778
  3+|[#key-prefix-title-page-subtitle]*Key Prefix:* <<key-prefix-title-page-subtitle,title-page-subtitle>>
1759
1779
 
1780
+ |display
1781
+ |none +
1782
+ (default: _not set_)
1783
+ |title-page:
1784
+ subtitle:
1785
+ display: none
1786
+
1760
1787
  |font-color
1761
1788
  |<<colors,Color>> +
1762
1789
  (default: _inherit_)
@@ -1815,6 +1842,13 @@ TIP: The title page can be disabled for the book doctype by setting the `notitle
1815
1842
 
1816
1843
  3+|[#key-prefix-authors]*Key Prefix:* <<key-prefix-authors,title-page-authors>>
1817
1844
 
1845
+ |display
1846
+ |none +
1847
+ (default: _not set_)
1848
+ |title-page:
1849
+ authors:
1850
+ display: none
1851
+
1818
1852
  |delimiter
1819
1853
  |<<quoted-string,Quoted string>> +
1820
1854
  (default: ', ')
@@ -1873,6 +1907,13 @@ TIP: The title page can be disabled for the book doctype by setting the `notitle
1873
1907
 
1874
1908
  3+|[#key-prefix-revision]*Key Prefix:* <<key-prefix-revision,title-page-revision>>
1875
1909
 
1910
+ |display
1911
+ |none +
1912
+ (default: _not set_)
1913
+ |title-page:
1914
+ revision:
1915
+ display: none
1916
+
1876
1917
  |delimiter
1877
1918
  |<<quoted-string,Quoted string>> +
1878
1919
  (default: ', ')
@@ -2171,6 +2212,7 @@ The keys in this category are used to control the style of literal, listing and
2171
2212
  |code:
2172
2213
  linenum-font-color: #ccc
2173
2214
  |===
2215
+
2174
2216
  . The line-gap property is used to tune the height of the background color applied to a span of block text highlighted using Rouge.
2175
2217
  . The code-linenum category only applies when using Pygments as the source highlighter.
2176
2218
  Otherwise, the style is controlled by the source highlighter theme.
@@ -2300,6 +2342,7 @@ The keys in this category apply to a button reference (generated from the inline
2300
2342
  |button:
2301
2343
  font-style: normal
2302
2344
  |===
2345
+
2303
2346
  . The border is only used if a border color is specified and the border width is not explicitly set to 0.
2304
2347
  . The border offset is the amount that the background and border swells around the text.
2305
2348
  It does not affect the distance between the formatted phrase and the phrases that surround it.
@@ -2376,6 +2419,7 @@ The keys in this category apply to a key reference (generated from the inline kb
2376
2419
  |key:
2377
2420
  font-style: normal
2378
2421
  |===
2422
+
2379
2423
  . The border is only used if a border color is specified and the border width is not explicitly set to 0.
2380
2424
  . The border offset is the amount that the background and border swells around the text.
2381
2425
  It does not affect the distance between the formatted phrase and the phrases that surround it.
@@ -3062,6 +3106,7 @@ The keys in this category control the SVG integration.
3062
3106
  |svg:
3063
3107
  fallback_font_family: Times-Roman
3064
3108
  |===
3109
+
3065
3110
  . The fallback font family is only used when the font family in the SVG does not map to a known font name from the font catalog.
3066
3111
 
3067
3112
  [#keys-lead]
@@ -3725,6 +3770,7 @@ The keys in this category control the arrangement and style of tables and table
3725
3770
  header-cell:
3726
3771
  text-transform: uppercase
3727
3772
  |===
3773
+
3728
3774
  . This key only controls the color that is used for stripes.
3729
3775
  The appearance of stripes is controlled using the `stripes` table attribute, the `table-stripes` document attribute (since Asciidoctor 2), or the `stripes` document attribute (prior to Asciidoctor 2).
3730
3776
  Permitted attribute values are even, odd, all, and none.
@@ -3979,14 +4025,6 @@ To avoid this problem, reduce the height of the running content periphery or mak
3979
4025
  |===
3980
4026
  |Key |Value Type |Example
3981
4027
 
3982
- 3+|[#key-prefix-running-content]*Key Prefix:* <<key-prefix-running-content,running-content>>
3983
-
3984
- |start-at
3985
- |title {vbar} toc {vbar} body +
3986
- (default: body)
3987
- |running-content:
3988
- start-at: toc
3989
-
3990
4028
  3+|[#key-prefix-header]*Key Prefix:* <<key-prefix-header,header>>
3991
4029
 
3992
4030
  |background-color^[1]^
@@ -4083,7 +4121,7 @@ To avoid this problem, reduce the height of the running content periphery or mak
4083
4121
  |top {vbar} middle {vbar} bottom +
4084
4122
  (default: middle)
4085
4123
  |header:
4086
- vertical-align: center
4124
+ vertical-align: middle
4087
4125
 
4088
4126
  |<side>-columns^[5]^
4089
4127
  |Column specs triple +
@@ -4212,7 +4250,16 @@ To avoid this problem, reduce the height of the running content periphery or mak
4212
4250
  verso:
4213
4251
  center:
4214
4252
  content: '\{page-number}'
4253
+
4254
+ 3+|[#key-prefix-running-content]*Key Prefix:* <<key-prefix-running-content,running-content>>
4255
+
4256
+ |start-at^[7]^
4257
+ |title {vbar} toc {vbar} body +
4258
+ (default: body)
4259
+ |running-content:
4260
+ start-at: toc
4215
4261
  |===
4262
+
4216
4263
  . The background color spans the width of the page, as does the border when a background color is specified.
4217
4264
  . *If the height is not set, the running content at this periphery is disabled.*
4218
4265
  . If the side padding is negative, the content will bleed into the margin of the page.
@@ -4221,16 +4268,65 @@ To avoid this problem, reduce the height of the running content periphery or mak
4221
4268
  The `columns` key can also be defined one level up (on `header` or `footer`), in which case the setting will be inherited.
4222
4269
  Where the page sides fall in relation to the physical or printed page number is controlled using the `pdf-folio-placement` attribute (except when `media=prepress`, which implies `physical`).
4223
4270
  . `<position>` can be `left`, `center` or `right`.
4271
+ . The `toc` value only applies if the toc is in the default location (before the first page of the body).
4272
+ If the toc macro is used to position the toc, the start-at behavior is the same as if the toc is not enabled.
4224
4273
 
4225
4274
  IMPORTANT: If you don't specify a height for either the header or footer key, it effectively disables the content at that periphery.
4226
4275
 
4276
+ TIP: Although not listed in the table above, you can control the font settings (font-family, font-size, font-color, font-style, text-transform) that get applied to the running content in each column position for each page side (e.g., `footer-<side>-<position>-font-color`).
4277
+ For example, you can set the font color used for the right-hand column on recto pages by setting `footer-recto-right-font-color: 6CC644`.
4278
+
4227
4279
  If you define running header and footer content in your theme (including the height), you can still disable this content per document by setting the `noheader` and `nofooter` attributes in the AsciiDoc document header, respectively.
4228
4280
 
4229
- If content is not specified for the running footer, the page number (i.e., `\{page-number}`) is shown on the left on verso pages and the right on recto pages.
4230
- You can disable this behavior by defining the attribute `nofooter` in the AsciiDoc document header or by defining the key `footer-<side>-content: none` in the theme.
4281
+ If you extend either the base or default theme, and don't specify content for the footer, the current page number will be added to the right side on recto pages and the left side on verso pages.
4282
+ To disable this behavior, you can use the following snippet:
4231
4283
 
4232
- TIP: Although not listed in the table above, you can control the font settings (font-family, font-size, font-color, font-style, text-transform) that get applied to the running content in each column position for each page side (e.g., `footer-<side>-<position>-font-color`).
4233
- For example, you can set the font color used for the right-hand column on recto pages by setting `footer-recto-right-font-color: 6CC644`.
4284
+ [source,yaml]
4285
+ ----
4286
+ extends: default
4287
+ footer:
4288
+ recto:
4289
+ right:
4290
+ content: ~
4291
+ verso:
4292
+ left:
4293
+ content: ~
4294
+ ----
4295
+
4296
+ Instead of erasing the content (which is what the `~` does), you can specify content of your choosing.
4297
+
4298
+ If you want to replace the alternating page numbers with a centered page number, then you can restrict the footer to a single column and specify the content for the center position.
4299
+
4300
+ [source,yaml]
4301
+ ----
4302
+ extends: default
4303
+ footer:
4304
+ columns: =100%
4305
+ recto:
4306
+ center:
4307
+ content: '{page-number}'
4308
+ verso:
4309
+ center:
4310
+ content: '{page-number}'
4311
+ ----
4312
+
4313
+ In the last two examples, the recto and verso both have the same content.
4314
+ In this case, you can reduce the amount of configuring using a YAML reference.
4315
+ For example:
4316
+
4317
+ [source,yaml]
4318
+ ----
4319
+ extends: default
4320
+ footer:
4321
+ columns: =100%
4322
+ recto: &shared_footer
4323
+ center:
4324
+ content: '{page-number}'
4325
+ verso: *shared_footer
4326
+ ----
4327
+
4328
+ The `&shared_footer` assigns an ID to the YAML subtree under the `recto` key and the `*shared_footer` outputs a copy of it under the `verso` key.
4329
+ This technique can be used thoughout the theme file as it's a core feature of YAML.
4234
4330
 
4235
4331
  ==== Attribute References
4236
4332
 
@@ -4247,10 +4343,11 @@ In addition, the following attributes are also available when defining the conte
4247
4343
  * section-or-chapter-title
4248
4344
 
4249
4345
  If you reference an attribute which is not defined, all the text on that same line in the running content will be dropped.
4346
+ This feature allows you to have alternate lines that are selected when all the attribute references are satisfied.
4250
4347
  One case where this is useful is when referencing the `page-number` attribute.
4251
4348
  If you unset the `pagenums` attribute on the document, any line in the running content that makes reference to `\{page-number}` will be dropped.
4252
4349
 
4253
- You can also built-in AsciiDoc text replacements like `+(C)+`, numeric character references like `+&#169;+` and inline formatting (e.g., bold, italic, monospace).
4350
+ You can also built-in AsciiDoc text replacements like `+(C)+`, numeric character references like `+&#169;+`, hexidecimal character references like `+&#x20ac;+`, and inline formatting (e.g., bold, italic, monospace).
4254
4351
 
4255
4352
  Here's an example that shows how attributes and replacements can be used in the running footer:
4256
4353
 
@@ -4469,7 +4566,11 @@ These settings override equivalent keys defined in the theme file, where applica
4469
4566
  |flag (default: _not set_)
4470
4567
  |:pdfmark:
4471
4568
 
4472
- |text-align^[7]^
4569
+ |scripts^[7]^
4570
+ |cjk (default: _not set_)
4571
+ |:scripts: cjk
4572
+
4573
+ |text-align^[8]^
4473
4574
  |<<text-alignments,Text alignment>>
4474
4575
  |:text-align: left
4475
4576
 
@@ -4477,7 +4578,7 @@ These settings override equivalent keys defined in the theme file, where applica
4477
4578
  |path^[2]^ {vbar} image macro^[3]^
4478
4579
  |:title-logo-image: image:logo.png[top=25%, align=center, pdfwidth=0.5in]
4479
4580
 
4480
- |title-page^[8]^
4581
+ |title-page^[9]^
4481
4582
  |flag (default: _not set_)
4482
4583
  |:title-page:
4483
4584
 
@@ -4485,7 +4586,7 @@ These settings override equivalent keys defined in the theme file, where applica
4485
4586
  |path^[2]^ {vbar} image macro^[3]^
4486
4587
  |:title-page-background-image: image:title-bg.jpg[]
4487
4588
 
4488
- |toc-max-pagenum-digits^[9]^
4589
+ |toc-max-pagenum-digits^[10]^
4489
4590
  |Integer (default: 3)
4490
4591
  |:toc-max-pagenum-digits: 4
4491
4592
  |===
@@ -4503,6 +4604,10 @@ To disable the background image for a side, use the value `none`.
4503
4604
  . Controls whether the implicit `page-number` attribute is to the running header and footer content specified in the theme file.
4504
4605
  Instead of disabling page numbers, you can use the `noheader` and `nofooter` attributes to disable the running header and footer, respectively.
4505
4606
  . Enables generation of the http://milan.kupcevic.net/ghostscript-ps-pdf/#marks[pdfmark] file, which contains metadata that is fed to Ghostscript when optimizing the PDF file.
4607
+ . Activates line break rules for CJK languages (specifically Chinese and Japanese).
4608
+ Chinese and Japanese are written without spaces (and may not use spaces when mixing with English words either).
4609
+ This setting allows a line break to be placed between any two CJK characters to accommodate wrapping.
4610
+ These languages also use different punctuation for pause, full stop, and dash, which are taken into account when breaking lines.
4506
4611
  . _(Experimental)_ The `text-align` document attribute is intended as a simple way to toggle text justification.
4507
4612
  The value of this attribute overrides the `base-align` key set by the theme.
4508
4613
  For more fine-grained control, you should customize using the theme.