asciidoctor / asciidoctor-tabs

An extension for Asciidoctor that adds a tabs block to the AsciiDoc syntax.
MIT License
40 stars 7 forks source link

Opal throws an error with Antora #69

Closed jcayouette closed 9 months ago

jcayouette commented 9 months ago

I am trying to use asciidoctor-tabs as an extension with Antora. I have added both the CSS and Javascript to our supplemental files but when I attempt to register the extension via our make file in the form of:

npx antora --extension @antora/lunr-extension --extension @asciidoctor/tabs --stacktrace

The build command fails with:

    Cause: ReferenceError
        at Object.<anonymous> (/home/docproduction/projects/uyuni-docs/node_modules/@asciidoctor/tabs/dist/index.js:257:4)
        at Module._compile (node:internal/modules/cjs/loader:1376:14)
        at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
        at Module.load (node:internal/modules/cjs/loader:1207:32)
        at Module._load (node:internal/modules/cjs/loader:1023:12)
        at Module.require (node:internal/modules/cjs/loader:1235:19)
        at require (node:internal/modules/helpers:176:18)
        at Object.<anonymous> (/home/docproduction/projects/uyuni-docs/node_modules/@asciidoctor/tabs/lib/extensions.js:3:1)
        at Module._compile (node:internal/modules/cjs/loader:1376:14)
        at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
make: *** [Makefile.en:44: antora-suma-en] Error 1```

These tabs would be very useful for us! If you can provide insight on how we might achieve this I would be grateful.

@asciidoctor/tabs 1.0.0-beta.6 asciidoctor@3.0.3 @antora/cli: 3.1.7 @antora/site-generator: 3.1.7

Perhaps a similar issue as: https://github.com/asciidoctor/asciidoctor-tabs/issues/66

If this is the case how can I avoid this error?

mojavelinux commented 9 months ago

The --extension option is not how you register an Asciidoctor extension. That's for registering in Antora extension. The next version of Antora is going to show a clearer warning when this situation occurs.

The correct way to enable an Asciidoctor extension is to use the playbook as follows:

asciidoc:
  extensions:
  - '@asciidoctor/tabs'

This is explained in the Antora integration guide. See https://github.com/asciidoctor/asciidoctor-tabs/blob/main/docs/use-with-antora.adoc#generator

In the future, please ask questions about usage in the project chat. In this case, it should be the Antora chat at https://chat.antora.org. Thanks!

mojavelinux commented 9 months ago

Perhaps a similar issue as: #66

No it is not. Antora uses Asciidoctor.js 2 and is thus compatible with the current release of Asciidoctor Tabs.

jcayouette commented 8 months ago

Will do, thank you @mojavelinux .