asciidoctor / asciidoctor-vscode

AsciiDoc support for Visual Studio Code using Asciidoctor
Other
340 stars 97 forks source link

Coderay css error #69

Closed SandMann1 closed 6 years ago

SandMann1 commented 6 years ago

My asciidocs use coderay as source code highlighter. It has its own css. Untill recently this did not affect the preview, but now the preview fails showing error message: image

Any way to tell the preview where to find the css or bypass this issue? We would be happy if the rest of the text would preview.

joaompinto commented 6 years ago

Hi, thanks for reporting the problem, can you please provide a zip file with a sample .adoc and the css structure ?

Thanks

SandMann1 commented 6 years ago

Attached is a .zip with an example. In the styles catalog you will find the coderay css. In the bin catalog you can see an example of the finished build using asciidoctor and coderay gems.

As you can see I use a setup file in the beginning. This adoc I reuse across all documents and it is always included in the beginning of my documents. As I mentioned earlier, the main issue is that nothing previews. If you can make the syntax highlighter work in preview - great, but if the source blocks just renders genericly thats no problem.

adoc-previewWithCoderayProblem.zip

SandMann1 commented 6 years ago

Simply removing this line :source-highlighter: coderay from the setup.adoc resolves the problem for preview but breakes my beutiful codeblocks in the end result.

Perhaps it is possible to just ignore this attribute before rendering?

joaompinto commented 6 years ago

@SandMann1, in a recent version of the extension the default asciidoc renger engine was changed from Asciidoctor (Ruby) to Asciidoctor(.JS), there are multiple source highlighters, but they only work on specific engines, you can find the list at: https://asciidoctor.org/docs/user-manual/#enabling-source-highlighting You have the following options:

  1. Change setup.adoc, to use "highlightjs" instead of "coderay"
  2. Change the vscode asciidoc settings to use asciidoctor (ruby):
    "AsciiDoc.asciidoctor_command": "asciidoctor -r asciidoctor-diagram -o-",
    "AsciiDoc.use_asciidoctor_js": false,
crra commented 6 years ago

@SandMann1 not sure if you need the diagram extension. You can remove the-r asciidoctor-diagram.

SandMann1 commented 6 years ago

Thank you for excellent and quick response. - SandMan