An extension for Asciidoctor.js and Asciidoctor to convert diagrams to images using Kroki.
Full documentation is available at https://docs.asciidoctor.org/kroki-extension/latest.
Install the dependencies:
npm i asciidoctor asciidoctor-kroki
Register and use the extension:
import { convert, Extensions } from '@asciidoctor/core'
import { register } from 'asciidoctor-kroki'
const registry = Extensions.create()
register(registry)
console.log(await convert('[graphviz]\n....\ndigraph G { Hello->World }\n....', { extension_registry: registry }))For installation instructions for Node.js, Browser, Ruby, and Antora, as well as the full configuration reference, see the documentation.
To build this project, you will need the latest active LTS of Node.js.
We recommend volta to manage multiple active Node.js versions.
-
Install the dependencies:
npm i -
Build the project:
npm run build
When working on a new feature or when fixing a bug, make sure to run the formatter, the linter and the test suite:
npm run format
npm run lint
npm run test