asciidoctor-vscode
asciidoctor-vscode copied to clipboard
Some requests/idea on asciidoctorconfig file
Hello Thank you for finishing up the main work from #682 .
Personally I use a folder for all the documentation of a project. But in version 2.9, I was able to use different VSCode workspace files which was declared different docinfo folder to be used for different usages. For example one to create an export which fits better for view in web browser with some added javascripts (like copy to clipboard button) and one which fits better for printing with doc type of book and some addition in the CSS like page and media.
In the new version I can only use one .asciidoctorconfig file.
I also tried to workaround this limitation by using a VSCode workspace file which includes two different folder as its root, one for the docs and one for the .asciidoctorconfig file, but it resulted in the extension not being able to find .asciidoctorconfig.
Is it possible to add a config item in the extension which also supports the ${workspaceFolder} variable syntax in the path (like before) and the set config with the current behavior before being modified?
Thank you all for the good work
I also encountered another problem, I must set Use Workspace Root As Base Directory to be able to use single .asciidoctorconfig file for all the folders, or I must put one in each directory/sub-directory the document is exist.
As a consequence of enabling this config, I am unable to put the images or other included file related to the current document, beside it and refer to it with a relative path/name.
It is also looks like a bug, as when enabling this config, the images (but not other included docs) showed up in the preview but when generating a HTML export, it does not! Also if I enter the image full path, it shows up in the export but not in the preview!!
Update on this seemingly bug:
I use :allow-uri-read:. If I disable this, the image bug does not occerred, but dissabling this resulted in all images and Kroki diagrams not embedded in the HTML export.
Sorry for too much noise!
I read .asciidoctorconfig related source code and found that it searches the current folder and all the parent folder and concluded that something is wrong with my setup.
I found that when I dont set Use Workspace Root As Base Directory the extension always find the .asciidoctorconfig from the root folder but the problem is the relative path I use in it for docinfo path, which cannot be resolved from the current document directory.
Is there a way to use the VSCode ${workspaceFolder} variable in the path?
Thanks
Hey! Could you please provide a repository with a simplified example of your current directory structure? Please also commit VS code extension settings.
I don't recommend using a VS code variable (workspaceFolder) in a docinfo file since this variable won't be resolved outside VS code.