diff options
| author | Dan Allen <dan.j.allen@gmail.com> | 2023-05-24 23:57:30 -0600 |
|---|---|---|
| committer | Dan Allen <dan.j.allen@gmail.com> | 2023-05-25 01:07:40 -0600 |
| commit | aecd91a324bb055664bcb90fddf92877c175c710 (patch) | |
| tree | 4dd1329f2984f457f1ab8b69889d8b852b5d736c /docs | |
| parent | 6de2815a6728833bef07455f505a06ae275ffd38 (diff) | |
use --theme CLI option in examples in place of -a pdf-theme
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/modules/extend/pages/use-cases.adoc | 2 | ||||
| -rw-r--r-- | docs/modules/theme/pages/apply-theme.adoc | 7 | ||||
| -rw-r--r-- | docs/modules/theme/pages/custom-font.adoc | 12 | ||||
| -rw-r--r-- | docs/modules/theme/pages/font-support.adoc | 2 | ||||
| -rw-r--r-- | docs/modules/theme/pages/print-and-prepress.adoc | 4 |
5 files changed, 14 insertions, 13 deletions
diff --git a/docs/modules/extend/pages/use-cases.adoc b/docs/modules/extend/pages/use-cases.adoc index f6d3d45f..083ef4c6 100644 --- a/docs/modules/extend/pages/use-cases.adoc +++ b/docs/modules/extend/pages/use-cases.adoc @@ -323,7 +323,7 @@ include::example$pdf-converter-code-with-wrap-indicator.rb[] This converter uses the return key character as the line wrap indicator. When using the built-in themes, the glyph for this character is only available in the fallback font. -Therefore, as written, this converter requires you to use the fallback font (i.e., `-a pdf-theme=default-with-font-fallbacks`) unless your theme uses a custom font that supports this character. +Therefore, as written, this converter requires you to use the fallback font (i.e., `--theme default-with-font-fallbacks`) unless your theme uses a custom font that supports this character. This extended converter does not attempt to change how lines are wrapped, and thus cannot make room for itself. Rather, it adds the wrap indicator after the wrapped line has been rendered. diff --git a/docs/modules/theme/pages/apply-theme.adoc b/docs/modules/theme/pages/apply-theme.adoc index a0f497cb..c7ca2432 100644 --- a/docs/modules/theme/pages/apply-theme.adoc +++ b/docs/modules/theme/pages/apply-theme.adoc @@ -8,6 +8,7 @@ This is done using AsciiDoc attributes. There are three AsciiDoc attributes that tell Asciidoctor PDF how to locate and apply your theme. pdf-theme:: The name or file path of the theme to load. +Can be set using the `--theme` CLI option. When using JRuby, the file path may begin with `uri:classloader:` to reference a location on the classpath. + If the value of the `pdf-theme` attribute ends with `.yml` (e.g., `custom-theme.yml`), the name is assumed to be an absolute or relative file path. @@ -62,7 +63,7 @@ Here's the formal way of loading your theme when calling Asciidoctor PDF: $ asciidoctor-pdf -a pdf-theme=basic -a pdf-themesdir=resources/themes -a pdf-fontsdir=resources/fonts doc.adoc -You can shorten `-a pdf-theme=` to `--theme`: +You can replace the `pdf-theme` attribute assignment with `--theme`, which does the same thing: $ asciidoctor-pdf --theme basic -a pdf-themesdir=resources/themes -a pdf-fontsdir=resources/fonts doc.adoc @@ -75,7 +76,7 @@ You can skip setting the `pdf-themesdir` attribute by passing the relative path $ asciidoctor-pdf --theme resources/themes/basic-theme.yml -a pdf-fontsdir=resources/fonts doc.adoc -In this case, the `pdf-themesdir` will be set automatically to the directory of the path specified by the `pdf-theme` attribute ([.path]_resources/themes_ in the previous example). +In this case, the `pdf-themesdir` will be set automatically to the directory of the theme path specified either by the `pdf-theme` attribute or the `--theme` option (e.g., [.path]_resources/themes_ in the previous example). If a relative path is specified for `pdf-themesdir` or `pdf-fontsdir`, or `pdf-theme` when `pdf-themesdir` is not specified, that path is resolved starting from the current working directory. Alternately, you can use `+{docdir}+` as the first path segment to anchor them to the directory of the source document instead. @@ -100,6 +101,6 @@ Speaking of Java, you can bundle and distribute your theme and fonts in a jar fi To reference the theme file and/or directory of fonts from inside the jar, refer to their location on the classpath using the `uri:classloader:` prefix. Here's how you'd load both the theme and fonts from the classpath: - $ asciidoctorj -b pdf -a pdf-theme=uri:classloader:/path/to/themes/my-theme.yml -a pdf-fontsdir=uri:classloader:/path/to/fonts document.adoc + $ asciidoctorj -b pdf --theme uri:classloader:/path/to/themes/my-theme.yml -a pdf-fontsdir=uri:classloader:/path/to/fonts document.adoc This only works when running Asciidoctor PDF with JRuby (i.e., on the JVM). diff --git a/docs/modules/theme/pages/custom-font.adoc b/docs/modules/theme/pages/custom-font.adoc index 9cf148e2..e2fc0f70 100644 --- a/docs/modules/theme/pages/custom-font.adoc +++ b/docs/modules/theme/pages/custom-font.adoc @@ -120,25 +120,25 @@ This will allow you to use the same font names (aka families) in both your graph [#configure-search-path] == Configuring the font search path -When you execute Asciidoctor PDF, specify the directory where the fonts reside using the `pdf-fontsdir` attribute: +When you invoke Asciidoctor PDF, specify the directory where the fonts reside using the `pdf-fontsdir` attribute: - $ asciidoctor-pdf -a pdf-theme=basic-theme.yml -a pdf-fontsdir=path/to/fonts document.adoc + $ asciidoctor-pdf --theme basic-theme.yml -a pdf-fontsdir=path/to/fonts document.adoc You can specify multiple directories by separating the paths with either a comma (`,`): - $ asciidoctor-pdf -a pdf-theme=basic-theme.yml -a pdf-fontsdir=path/to/fonts,path/to/more-fonts document.adoc + $ asciidoctor-pdf --theme basic-theme.yml -a pdf-fontsdir=path/to/fonts,path/to/more-fonts document.adoc or a semicolon (`;`) (which requires enclosing the combined value in double quotes to escape the delimiter from the shell): - $ asciidoctor-pdf -a pdf-theme=basic-theme.yml -a pdf-fontsdir="path/to/fonts;path/to/more-fonts" document.adoc + $ asciidoctor-pdf --theme basic-theme.yml -a pdf-fontsdir="path/to/fonts;path/to/more-fonts" document.adoc To include the location of the bundled fonts in the search, include the `GEM_FONTS_DIR` token in the list: - $ asciidoctor-pdf -a pdf-theme=basic-theme.yml -a pdf-fontsdir="path/to/fonts;GEM_FONTS_DIR" document.adoc + $ asciidoctor-pdf --theme basic-theme.yml -a pdf-fontsdir="path/to/fonts;GEM_FONTS_DIR" document.adoc When running Asciidoctor PDF on the JVM (perhaps using AsciidoctorJ PDF), you can refer to a directory inside any JAR file on the classpath by prefixing the path with `uri:classloader:`: - $ asciidoctorj -b pdf -a pdf-theme=basic-theme.yml -a pdf-fontsdir="uri:classloader:/path/to/fonts;GEM_FONTS_DIR" document.adoc + $ asciidoctorj -b pdf --theme basic-theme.yml -a pdf-fontsdir="uri:classloader:/path/to/fonts;GEM_FONTS_DIR" document.adoc [#subset] == Subsetting your font diff --git a/docs/modules/theme/pages/font-support.adoc b/docs/modules/theme/pages/font-support.adoc index 70bc319d..dd341823 100644 --- a/docs/modules/theme/pages/font-support.adoc +++ b/docs/modules/theme/pages/font-support.adoc @@ -127,7 +127,7 @@ It would also severely limit the style choices in the default theme, which cater If you're writing in a CJK language, such as Japanese, Asciidoctor PDF provides a built-in theme named `default-with-font-fallbacks` that provides a broad range of characters in the CJK charsets. You can start with that theme to see how far it gets you: - $ asciidoctor-pdf -a scripts=cjk -a pdf-theme=default-with-font-fallbacks document.adoc + $ asciidoctor-pdf -a scripts=cjk --theme default-with-font-fallbacks document.adoc Notice the `-a scripts=cjk` option. That's important. diff --git a/docs/modules/theme/pages/print-and-prepress.adoc b/docs/modules/theme/pages/print-and-prepress.adoc index af929b98..e54d06e3 100644 --- a/docs/modules/theme/pages/print-and-prepress.adoc +++ b/docs/modules/theme/pages/print-and-prepress.adoc @@ -10,7 +10,7 @@ Asciidoctor PDF provides the following behaviors to assist with printing: * Deactivates the links from page numbers in the index to the locations of terms in the document To enable these printing features, set the `media` document attribute to `print` in the header of your AsciiDoc document or from the API or CLI (e.g., `-a media=print`). -You may also want to consider using the print-optimized theme, which uses darker, grayscale colors for text and borders (e.g., `-a pdf-theme=default-for-print`). +You may also want to consider using the print-optimized theme, which uses darker, grayscale colors for text and borders (e.g., `--theme default-for-print`). [#prepress] == Prepress mode @@ -22,7 +22,7 @@ In addition to the <<print,print mode>>, Asciidoctor PDF provides the following Set the `media` attribute to `prepress` in the header of your AsciiDoc document or from the API or CLI (e.g., `-a media=prepress`) to activate the publishing features. The following sections describe the behaviors that this setting activates. -You may also want to consider using the print-optimized theme, which uses darker, grayscale colors for text and borders (e.g., `-a pdf-theme=default-for-print`). +You may also want to consider using the print-optimized theme, which uses darker, grayscale colors for text and borders (e.g., `--theme default-for-print`). === Double-sided page margins |
