asciidoctor / asciidoctor-vscode

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

Preview images from other modules of Antora #358

Open elsav-emrs opened 4 years ago

elsav-emrs commented 4 years ago

Is your feature request related to a problem? Please describe

In our documentation, we do have a series of common assets to multiple modules, for example the icons. Thus in a document, we may have images coming from multiple sources. We can easily cross-reference within antora but the asciidoc preview in VS does not seem to support this configuration.

modules
|__ module1
   |__ images
   |__ pages
        |__ mydoc.adoc   
             ... Click image:zAll:zButtons/openFile.svg[] ...

|__ zAll
     |__ images
         |__ zButtons
              |__ openFile.svg
     |__ pages
              |__ _attributes.adoc

Note: For preview, we currently configure the attribute imagesdir to "../images", which works fine for most of the images. But we miss these common assets.

Describe the solution you'd like

Preview images to understand the coordinate of a resource, as described here: https://docs.antora.org/antora/2.3/page/resource-id/.

In our case, simply supporting the standard antora infrastructure would be enough.

For example:

[x] Automatically set imagedir from standard antora infrastructure.
Site description: [ site.yml ]

Describe alternatives you've considered

We are beginners to the system and may have not seen alternatives, so any better suggestion is welcome.

Additional context

We have a similar issue with include files. We have a series of common variables that describe product names, zones of interface or reusable sentences.

include::zAll:page$_attributes.adoc[]

For the include, we may opt to use the relative path instead of the ref ID, which will be compatible for the two modes. We are afraid that doing the same for images will make the document reading more complex.

include::../../zAll/pages/_attributes.adoc[]

prudhomm commented 4 years ago

it may be a duplicate of #230 , see also #280 for a conditional env to check you are in vscode preview