Open wetzesa opened 4 years ago
Yes, it must be a path to a CSS stylesheet. This is for the generation of the html in the preview.
If I understand correctly, you are trying to generate a PDF using the Ruby asciidoctor-pdf.
I think it should work within a workspace or folder but happy to take but reports for this.
If I read the asciidoctor-pdf README correctly what you must do to use a custom theme is:
Set the "Use_asciidoctorpdf" option:
Set the asciidoctor-pdf command to something like: asciidoctor-pdf -a pdf-themesdir=themes -a pdf-theme=custom -a pdf-fontsdir=fonts
.
This is an OK solution but not very portable across documents which use different themes or folder structures.
Perhaps a better alternative than setting the asciidoctor-pdf command is to leave the Asciidoctorpdf_command
as asciidoctor-pdf
without any arguments and set in your document header the pdf-
attributes like for instance the following:
@wetzesa I think your theme should have a name with a suffix -theme.yml
, e.g. custom-theme.yml
according to the asciidoctor-pdf theming guide.
Then for the folder structure you showed you should be able to use the document attributes:
:pdf-themesdir: ../themes
:pdf-theme: custom
Let us know how you go!
(I tested this by using https://github.com/mderoullers/asciidoctor-pretty-theme and opening src/main/asciidoc/example.adoc
which is where the above screenshot came -- that might be a good example to look at if you're having trouble getting your theme to run)
I would like to show my custom pdf theme in preview mode.
My project structure is like...
|- projectRoot |-- docFolder |--- doc.adoc |-- shared |--- theme |---- theme.yml
I copied the theme.yml also to the projectRoot or to docFolder and changed the config but hadn't any affect. I changed many times the path because the config is not complete clear how it is to set. So I am now not sure if I do something wrong or the feature isn't working.
I hope someone can help me with that very very small issue ;-)
Additionally: I am also a bit wondering about the field descripton "...path to a CSS style sheet to use...". Must it be a CSS file and a theme.yml is not working? The 2nd wondering in the field description was "...to the workspace folder." Does it only work with a workspace project or is it also working if I used the "Open folder" option in VS Code?