-
Notifications
You must be signed in to change notification settings - Fork 500
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Behaviour of relative path resolution #412
Comments
Ok, I thought I just copy the themes folder into the subfolder documents without touching the build script. Resulting error message: I copy the folder themes back into the folder concepts and I get the error message: confused Having |
In general, I don't recommend using relative paths for roots like pdf-stylesdir. It is best to use Gradle to resolve the absolute path. Can you confirm you have done that step? |
Good to know, thanks for the tip. I have the following build file now def workspaceDir = projectDir.getParentFile().getParentFile().getPath()
println "Workspace: " + workspaceDir
defaultTasks 'asciidoctor'
asciidoctor {
backends = ['pdf']
sourceDir 'docs'
attributes 'workspaceDir': workspaceDir,
'pdf-style': 'custom',
'pdf-stylesdir': workspaceDir+'/.themes/pdf'
} and it seems to work. |
The reason I recommend using an absolute path is because there are a lot of different roots involved here and, even if you can reason about them, it requires a lot of brain power to know what the relative path means. It's just much better in a build system to be using absolute paths resolved by the build tool. |
With Gradle, you should be able to use |
An open question is whether the pdf-stylesdir value, if a relative path, should be resolved relative to the base_dir option. |
…mesdir and pdf-fontsdir attributes
The value of
In Asciidoctor PDF 2, you will also be able to use the
|
…of pdf-themesdir and pdf-fontsdir attributes
Following the theming guide for PDFs, I am trying to set the attribute "pdf-stylesdir" and use a common theme for several documents using the following structure:
repo/concepts/themes
andrepo/concepts/documents/projXY/doc1/
In
doc1
I have a Gradle build file and a subdirectorycontent
with my asciidoc files.When I use
'pdf-stylesdir': '../../../themes/pdf'
in my build file in doc1 and I rungradle clean asciidoctor
the file is expected to be inrepo/concepts/documents/themes
(as expected, since it is relative to the source directory, which is the subdirectory docs in doc1).For the value
'pdf-stylesdir': '../../../../themes/pdf'
(one directory below), it searches inrepo
(two directories below). Looks a bit like a recursion bug.Sorry if this the wrong component of asciidoctor, I was not sure if this issue is related to asciidoctor, asciidoctor-pdf or the Gradle Plugin.
The text was updated successfully, but these errors were encountered: