diff options
| author | Dan Allen <dan.j.allen@gmail.com> | 2023-04-30 22:30:07 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-30 22:30:07 -0600 |
| commit | 5559941eb0bb23e72f2b64226415e071e257c347 (patch) | |
| tree | bf9ccbf09f7931d142fc207e290306aef88b9e2a /docs/modules/html-backend | |
| parent | 72259cb282fc80b5f9b30f25e9674ff2ef2c3f71 (diff) | |
resolves #3929 treat uri:classloader: as absolute path prefix when running on JRuby (PR #4444)
Diffstat (limited to 'docs/modules/html-backend')
| -rw-r--r-- | docs/modules/html-backend/pages/custom-stylesheet.adoc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/docs/modules/html-backend/pages/custom-stylesheet.adoc b/docs/modules/html-backend/pages/custom-stylesheet.adoc index 3b6f53c8..d808d9f9 100644 --- a/docs/modules/html-backend/pages/custom-stylesheet.adoc +++ b/docs/modules/html-backend/pages/custom-stylesheet.adoc @@ -159,12 +159,17 @@ That means we can use `stylesdir` and `stylesheet` to assemble the path relative Let's revisit the broken scenario from the previous section and use `copycss` to reconcile the problem: $ asciidoctor -a stylesdir=css -a stylesheet=default.css \ - -a copycss=`pwd`/my-styles/my-stylesheet.css -a linkcss -D public my-document.adoc + -a copycss=$PWD/my-styles/my-stylesheet.css -a linkcss -D public my-document.adoc Asciidoctor copies the stylesheet from the absolute path specified by the `copycss` attribute to the path [.path]_public/css/default.css_ and links to it using the path [.path]_css/default.css_. -Notice that we even changed the name of the folder and stylesheet file in the output. +Notice that we changed the name of the folder and stylesheet file in the output. That demonstrates that we have decoupled the path where the stylesheet is read from the location where the stylesheet is published and referenced. +TIP: When running on JRuby, you can point `copycss` to a classloader URI to load a stylesheet from a JAR file (e.g., `uri:classloader:/css/styles.css`). +However, the HTML cannot link to that location. +Therefore, you must use the `stylesheet` attribute (and optionally the `stylesdir`) to specify a filename or relative path where Asciidoctor will write the stylesheet. +The HTML will then be able to link to that destination. + == Styles directory and nested documents when linking When xref:cli:process-multiple-files.adoc[invoking Asciidoctor on a nested set of documents], it's currently not possible to specify a single relative path for the `stylesdir` attribute that works for all of the documents. |
