asciidoctor / asciidoctor-vscode

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

Is it possible to use Asciidoctor (ruby) unstead of asciidoctor.js? #81

Closed sindzicat closed 6 years ago

sindzicat commented 6 years ago

Hello!

My test.adoc:

= {docname}
:nofooter:
:imagesdir: {docname}_media

image::preview.jpg[]

Attribute {docname} doesn't work in asciidoctor.js and AsciiDoc VSCode extension but works nice when I use asciidoctor (ruby version).

I tried in settings:

"AsciiDoc.use_asciidoctor_js": false,
"AsciiDoc.asciidoctor_command": "C:\\Ruby25-x64\\bin\\asciidoctor",

but this didn't help me.

Is this possible to use Asciidoctor (ruby) unstead of asciidoctor.js?

Best regards, Andrey.

joaompinto commented 6 years ago

This will be fixed for Asciidoctor.js, it's a standard attibute so it should work, will be tracked on issue https://github.com/joaompinto/asciidoctor-vscode/issues/82 .

About using Ruby, yes, it should work, but not all features will be available, do you get an error on the preview window ?

Thanks

sindzicat commented 6 years ago

I need to export the result as HTML. Only Ruby version of Asciidoctor can do this.

sindzicat commented 6 years ago

Also, there are some plugins for Asciidoctor. They are on Ruby only...

sindzicat commented 6 years ago

but not all features will be available

Sorry, what features will not be available?

joaompinto commented 6 years ago

@sindzicat I will add an option to export to HTML (using AsciidoctorJS), yes asciidoctor (Ruby) has many plugins, that's why the option to use Ruby is still supported.

Right now the following features do not work with Asciidoctor Ruby:

rohel01 commented 6 years ago

Hello,

Can you clarify if Asciidoctor (ruby) can be used for live preview ? Currently, I think it does not work as I get different results between live preview and manual asciidoctor invocation.

For example, I want to use the pygments plugin but it does not work in live preview

My config

    "AsciiDoc.use_asciidoctor_js": false,
    "AsciiDoc.asciidoctor_command": "/usr/bin/asciidoctor"
joaompinto commented 6 years ago

@rohel01 Asciidoctor ruby should work (with the limitations reported above), do you get any error in the preview window ?

rohel01 commented 6 years ago

@joaompinto The error message in the preview window is

Pygments: uninitialized constant Pygments

Also, is there a way to provide arguments to Asciidoctor ? For example, it would be nice to have diagrams preview

asciidoctor -r asciidoctor-diagram my-note.adoc

Currently, I get no errors nor warnings, but my plantuml scripts are not rendered

2018-08-01 18:42 GMT+02:00 João Pinto notifications@github.com:

@rohel01 https://github.com/rohel01 Asciidoctor ruby should work (with the limitations reported above), do you get any error in the preview window ?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/joaompinto/asciidoctor-vscode/issues/81#issuecomment-409640547, or mute the thread https://github.com/notifications/unsubscribe-auth/AI7wK3I5-Xkbiw1xUGYydWN3e2nMq0Hlks5uMdpxgaJpZM4TvXWQ .

rohel01 commented 6 years ago

Dear @joaompinto, glad to see progress is being made on this issue.

I have checked the referenced PR, and it will help using asciidoctor-diagram.

Do you think this will also fix my issue regarding Pygments ?

joaompinto commented 6 years ago

@rohel01 pygments should work using the ruby version, do you still have the problem ? Do you get some error ?

rohel01 commented 6 years ago

I am still using 0.15.0. I can test a new release if you make one available.

rohel01 commented 6 years ago

I am installing from source as documented in the README.

joaompinto commented 6 years ago

There was an update a few minutes ago, you can use the extension package:

https://github.com/joaompinto/asciidoctor-vscode/releases/download/untagged-86ddf4d7b7d57c92250f/asciidoctor-vscode-0.15.1.vsix

https://code.visualstudio.com/docs/editor/extension-gallery#_install-from-a-vsix

rohel01 commented 6 years ago

The link to the vsix is dead

Le lun. 20 août 2018 à 12:26, João Pinto notifications@github.com a écrit :

There was an update a few minutes ago, you can use the extension package:

https://github.com/joaompinto/asciidoctor-vscode/releases/download/untagged-86ddf4d7b7d57c92250f/asciidoctor-vscode-0.15.1.vsix

https://code.visualstudio.com/docs/editor/extension-gallery#_install-from-a-vsix

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/joaompinto/asciidoctor-vscode/issues/81#issuecomment-414270022, or mute the thread https://github.com/notifications/unsubscribe-auth/AI7wKxIz615IwwJ-B0KeXWvNcEyKJ4f8ks5uSo7MgaJpZM4TvXWQ .

joaompinto commented 6 years ago

Sorry, that correct link is:

https://github.com/joaompinto/asciidoctor-vscode/releases/download/v0.15.1/asciidoctor-vscode-0.15.1.vsix

rohel01 commented 6 years ago

Using the vsix you supplied, I configured itto use my ruby install of Asciidoctor. I am happy to confirm that the live preview now can:

  1. Use Pygments as a source highlighter
  2. Have PlantUML diagrams rendered via the ascidoctor-diagram extension

Thank you for your work

Le lun. 20 août 2018 à 13:00, João Pinto notifications@github.com a écrit :

Sorry, that correct link is:

https://github.com/joaompinto/asciidoctor-vscode/releases/download/v0.15.1/asciidoctor-vscode-0.15.1.vsix

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/joaompinto/asciidoctor-vscode/issues/81#issuecomment-414278083, or mute the thread https://github.com/notifications/unsubscribe-auth/AI7wK-OEIDi0MCaUekf0bMHwNzlRIQQhks5uSpbCgaJpZM4TvXWQ .