From b5c91f76f37c0e1168c399193124e2017f63ec89 Mon Sep 17 00:00:00 2001 From: Alexander Schwartz Date: Fri, 20 Dec 2024 14:34:00 +0100 Subject: [PATCH] Update docs and templates to recommend an absolute path for the `pdf-fontsdir` (#1750) --- doc/users-guide/modules/ROOT/pages/faq.adoc | 5 ++++- .../pages/features/advanced/pdf-non-latin-languages.adoc | 2 +- src/main/resources/AsciiDocBundle.properties | 7 ++++--- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/doc/users-guide/modules/ROOT/pages/faq.adoc b/doc/users-guide/modules/ROOT/pages/faq.adoc index 4db8574c1..1db5d6505 100644 --- a/doc/users-guide/modules/ROOT/pages/faq.adoc +++ b/doc/users-guide/modules/ROOT/pages/faq.adoc @@ -116,7 +116,8 @@ See xref:faq/diagrams-in-pdf-without-text.adoc[] for more details. === Themes are not used when creating a PDF via the IDE -To use a theme when creating PDFs in the IDE, always specify an absolute directory pointing to the `themes` folder. +To use a theme when creating PDFs in the IDE, always specify an absolute directory pointing to the folders with the +themes and the fonts. When specifying the folder in a regular AsciiDoc file, use the `{docdir}` attribute as a prefix to point to a folder relative to the current document: @@ -124,6 +125,7 @@ relative to the current document: [source,asciidoc] ---- :pdf-themesdir: {docdir}/themes +:pdf-fontsdir: {docdir}/fonts ---- When specifying a theme relative in an `.asciidoctorconfig` file, use the folder of that file by prefixing `{asciidoctorconfigdir}`: @@ -131,6 +133,7 @@ When specifying a theme relative in an `.asciidoctorconfig` file, use the folder [source,asciidoc] ---- :pdf-themesdir: {asciidoctorconfigdir}/themes +:pdf-fontsdir: {asciidoctorconfigdir}/fonts ---- == Other Troubles diff --git a/doc/users-guide/modules/ROOT/pages/features/advanced/pdf-non-latin-languages.adoc b/doc/users-guide/modules/ROOT/pages/features/advanced/pdf-non-latin-languages.adoc index 839992db2..2a5d79bb4 100644 --- a/doc/users-guide/modules/ROOT/pages/features/advanced/pdf-non-latin-languages.adoc +++ b/doc/users-guide/modules/ROOT/pages/features/advanced/pdf-non-latin-languages.adoc @@ -21,7 +21,7 @@ A complete example is available in https://github.com/ahus1/asciidoctor-deepdive = 标题 :pdf-themesdir: {docdir}/themes <1> :pdf-theme: zh_CN <2> -:pdf-fontsdir: fonts <3> +:pdf-fontsdir: {docdir}/fonts <3> This is a show case for Chinese letters in AsciiDocs. diff --git a/src/main/resources/AsciiDocBundle.properties b/src/main/resources/AsciiDocBundle.properties index 6d3da908d..6419d4823 100644 --- a/src/main/resources/AsciiDocBundle.properties +++ b/src/main/resources/AsciiDocBundle.properties @@ -644,17 +644,18 @@ asciidoc.attributes.builtin.pdf-style.default-value=not set asciidoc.attributes.builtin.pdf-style.values=any asciidoc.attributes.builtin.pdf-themesdir.text=The directory where the theme file is located. Specifying an absolute path is recommended.\n\ -Prefix with {docdir} to ensure a path relative to the current document\n\ +Prefix with {docdir} to ensure a path relative to the current document.\n\ If you use images in your theme, image paths are resolved relative to this directory. If :pdf-theme: ends with .yml, and :pdf-themesdir: is not specified, then :pdf-themesdir: defaults to the directory of the path specified by :pdf-theme:. asciidoc.attributes.builtin.pdf-themesdir.default-value=not set asciidoc.attributes.builtin.pdf-themesdir.values=any asciidoc.attributes.builtin.pdf-stylesdir.text=The directory where the theme file is located. Specifying an absolute path is recommended.\n\ -Prefix with {docdir} to ensure a path relative to the current document\n\ +Prefix with {docdir} to ensure a path relative to the current document.\n\ If you use images in your theme, image paths are resolved relative to this directory. If :pdf-theme: ends with .yml, and :pdf-themesdir: is not specified, then :pdf-themesdir: defaults to the directory of the path specified by :pdf-theme:. asciidoc.attributes.builtin.pdf-stylesdir.default-value=not set asciidoc.attributes.builtin.pdf-stylesdir.values=any -asciidoc.attributes.builtin.pdf-fontsdir.text=The directory or directories where the fonts used by your theme, if any, are located. Multiple entries must be separated by a semi-colon. To reference a file inside a JAR file on the classpath, prefix with the path with uri:classloader: (AsciidoctorJ only). Specifying an absolute path is recommended. +asciidoc.attributes.builtin.pdf-fontsdir.text=The directory or directories where the fonts used by your theme, if any, are located. Multiple entries must be separated by a semi-colon. To reference a file inside a JAR file on the classpath, prefix with the path with uri:classloader: (AsciidoctorJ only). Specifying an absolute path is recommended.\n\ +Prefix with {docdir} to ensure a path relative to the current document. asciidoc.attributes.builtin.pdf-fontsdir.default-value=not set asciidoc.attributes.builtin.pdf-fontsdir.values=any