snt / antora-mermaid-extension

An Antora extension that adds Mermaid rendering to an Antora site.
2 stars 1 forks source link

Usage sample? #5

Closed roded closed 1 year ago

roded commented 1 year ago

Hello, I could use some assistance in getting this extension to work in the default Antora UI bundle and the latest Antora version. I have the following playbook:

antora:
  extensions:
    - require: '@sntke/antora-mermaid-extension'
site:
  title: ...
  url: /home/me/localpath
content:
  sources:
    - url: /home/me/localpath
      start_path: /home/me/localpath/docs
      branches: HEAD
ui:
  bundle:
    url: https://gitlab.com/antora/antora-ui-default/-/jobs/artifacts/HEAD/raw/build/ui-bundle.zip?job=bundle-stable
    snapshot: true

And this extension is installed via npm. I can see that the mermaid script is loaded via jsdelivr but the example sequence diagram does not seem to render:

[mermaid]
....
sequenceDiagram
autonumber

participant a as Alice
participant b as Bob

a ->>+ b : Hello.
b -->>- a : Hi, there.
....

Any pointers would be great. Thanks

P.S., I suspect that the mermaid_initialize_options as described in the README.md should not include the double quotes to avoid a JS error on start up.

roded commented 1 year ago

OK! I was missing korki:

antora {
    version.set("3.1.4")
    playbook.set(file("antora-playbook.yml"))
    packages.set(
        mapOf(
            "@antora/site-generator" to "3.1.4",
            "@sntke/antora-mermaid-extension" to "0.0.4",
            "asciidoctor-kroki" to "0.17.0",
        )
    )
}
asciidoc:
  extensions:
    - asciidoctor-kroki