Closed ioannisstavrakakis closed 2 years ago
Are you using Asciidoctor PDF or wkhtmltopdf
? Could you please share the workspace structure (i.e., where is located test.adoc
, where is located the file you are exporting to PDF? etc...)
I am using the asciidoctor-pdf engin, as checked in the extensions settings. Both adoc files are under the same folder.
Both adoc files are under the same folder.
And both AsciiDoc files are at the root of the workspace or inside a sub-directory? Do you use a custom asciidoctor-pdf
command? Did you install asciidoctor-pdf
locally using Bundler when the extension asks you or did you have asciidoctor-pdf
already installed?
I tried both moving the files at the root, and in subfolders, but it is the same result. I use a custom command which I have configured also in the extensions settings, i.e.:
asciidoctor-pdf -r asciidoctor-lists master.adoc -a pdf-theme=styles/theme.yml -a pdf-fontsdir=styles/assets -a source-highlighter=coderay --trace
I had already installed asciidoctor-pdf.
If I run the command in bash, everything works fine. And the Export PDF function works fine if the adoc does not contain include files.
I created a minimal master adoc and a minimal include adoc, without much content, nor formatting or document attributes, but it still does not work.
Have a go and let me know if you managed to produce a PDF like this one using the Export PDF wuick command: testmaster.pdf
Thanks for your input, I will try to reproduce. For reference, what is the absolute path to your workspace and to your AsciiDoc file? My guess is that the base directory is wrong and thus Asciidoctor PDF cannot resolve the target test.adoc
.
Not sure I understand. This is what I have:
I meant the absolute path such as c:\path\to\workspace
and c:\path\to\workspace\folder\test.adoc
I cannot reproduce this issue. Though, I found a bug in how we detect if a command is available or not.
Could you please share your settings? @ext:asciidoctor.asciidoctor-vscode pdf
I tried to move the files to another folder, and I got this: Unable to get the workspace folder, aborting.
I tried to move the files to another folder, and I got this: Unable to get the workspace folder, aborting.
That's expected, if your AsciiDoc file is not in a workspace folder we cannot continue. We are using the workspace folder to set the base directory.
Same settings for User and Workspace.
I meant the absolute path such as
c:\path\to\workspace
andc:\path\to\workspace\folder\test.adoc
C:\Users\istavrak\product_documentation\testmaster.adoc
C:\Users\istavrak\product_documentation\testmaster.adoc
Your path does not contain any special character... but maybe it's a Windows related issue 🤔 Do you notice anything different between what I'm doing and what you are doing?
Nothing different I am afraid... and again, it works perfectly for any other adoc that does not have include adocs.
And it should not be a problem of the asciidoctor-pdf because running the command from bash works perfectly.
This is really strange.. it is definitely a Windows thing.
I also selected and unselected the "asciidoc.useWorkspaceRootAsBaseDirectory" setting, but all the same.
Shouldn't the Export to PDF work also in the web VSC? There is not that option:
I managed to solve this by using the absolute path to the file:
include::C:\Users\istavrak\product_documentation\testinclude.adoc[]
It is not ideal, and I am not sure if this will cause any problems later when we will develop our Antora-based portal, but at least it works this way.
Shouldn't the Export to PDF work also in the web VSC? There is not that option:
The export relies on a binary (asciidoctor-pdf
or wkhtmltopdf
) and we cannot execute binary in VS Code Web. So it's intented.
I managed to solve this by using the absolute path to the file: include::C:\Users\istavrak\product_documentation\testinclude.adoc[] It is not ideal, and I am not sure if this will cause any problems later when we will develop our Antora-based portal, but at least it works this way.
You shouldn't do that. I might have an idea of why it's not working on Windows.
I can reproduce it on Windows. As expected, the base directory is wrong, we are using:
On Windows, docUri.root
is equals to c:\\
and docUri.dir
is c:\\path\\to\\workspace
. In the end, the baseDirectory
is c:\\c:\\path\\to\\workspace
.
Not sure why we do that, I will fix/simplify the code.
Thank you very much!
Yes, it works! Many thanks!
BTW, nice touch to have this prompt:
Much appreciated!
I'm glad you've noticed this small detail 😄
Are you kidding me? I live for such details 😅😅😅
Description
When exporting a PDF using "AsciiDoc: Export document as PDF" quick command, the resulting PDF does not include the included adoc files. The PDF states the following error message:
Unresolved directive in - include::test.adoc[tag=guide]
System Information
VSCode: 1.68.1 OS: Windows_NT x64 10.0.19044 AsciiDoc v3.0.0.
To Reproduce
Steps to reproduce the issue:
Additional Context
Running the asciidoctor-pdf bash command renders the PDF as expected.