asciidoctor / asciidoctor-kroki

Asciidoctor.js extension to convert diagrams to images using Kroki!

Home Page:https://kroki.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Declaring the use of the extension from the Antora CLI does not work

tl3gr4nd opened this issue · comments

Hello,

To build my documentation, I would like to use the Antora preloading system [1] instead of using the Antora global asciidoctor extension one [2]. That will avoid me to declare each time the extension in each Antora playbook (antora-playbook.yml).

When I execute Antora via the CLI using the --require argument, the diagrams are not generated in an image format but in the ditaa format:

antora --require 'asciidoctor-kroki' generate --attribute kroki-fetch-diagram=true" antora-playbook.yml

But, when I declare the extension in my playbook, that works even if I declare the attribute in the CLI command:

site:
  title: My documentation
content:
  sources:
    - url: ../
      branches: HEAD
      start_path: docs/src
ui:
  bundle:
    url: https://gitlab.com/antora/antora-ui-default/-/jobs/artifacts/HEAD/raw/build/ui-bundle.zip?job=bundle-stable
    snapshot: true
asciidoc:
   extensions:
     - asciidoctor-kroki
antora generate --attribute kroki-fetch-diagram=true" antora-playbook.yml

Do I misuse the extension or is it a bug?

[1] https://docs.antora.org/antora/latest/playbook/asciidoc-extensions/#preload-extensions
[2] https://docs.antora.org/antora/latest/playbook/asciidoc-extensions/#global-extensions

Antora has been upgraded to version 3.x, while the documentation for Kroki shows integration with version 2.x.
In the directory where the playbook.yml is located, executing 'npm i asciidoctor-kroki' will be successful.

I believe that --require is for Antora extensions not for Asciidoctor extensions.
In the future, please ask question using the community chat: https://chat.asciidoctor.org/ or https://chat.antora.org