You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Mermaid diagrams on the agent-integration pages are currently baked into pre-encoded kroki.io image URLs at Markdown→AsciiDoc conversion time. This works, but it makes every diagram a third-party runtime dependency at page-view time and leaves the diagram source unreadable in the .adoc. Adding the asciidoctor-kroki extension with kroki-fetch-diagram would render diagrams at build time into local site assets instead.
Current state
The pages under genai-ecosystem/genai-frameworks/ are generated from Markdown READMEs in neo4j-labs/neo4j-agent-integrations by scripts/publish-to-labs.py. Mermaid fenced blocks are deflate+base64-encoded into a URL:
Neither developer.yml nor labs.yml registers a diagram extension today — only remote-include and macros — so this pre-encoding is what makes the diagrams work at all.
Runtime dependency on kroki.io. The reader's browser fetches each SVG from kroki.io on page load. If it is down, rate-limiting, or blocked by a corporate network, diagrams silently vanish from published docs.
Diagram source is not in the .adoc. The encoded blob is opaque — not reviewable in a PR diff, not greppable, not editable without re-running the converter.
No control over rendering. No theming, and the SVG is whatever kroki.io's current mermaid version produces, which can change under us without a docs change.
Proposed change
1. package.json — add to devDependencies:
"asciidoctor-kroki": "^0.18.1"
Important
Pin to the 0.18.x line — do not use latest.asciidoctor-kroki@1.0.1 declares peerDependencies: { "@asciidoctor/core": ">=4.0.0 <5.0.0" }, but Antora 3.1 resolves @asciidoctor/core: ~2.2. Only 0.18.1 (>=2.2 <4.0) is compatible with the current Antora version. This becomes upgradable when the repo moves to Antora 4.x.
2. developer.yml and labs.yml — both source labs-pages@publish, so both need it:
asciidoc:
extensions:
- ./extensions/remote-include/remote-include-processor
- ./extensions/macros/macros
- asciidoctor-kroki # <-- addattributes:
experimental: ''kroki-fetch-diagram: true # <-- fetch at build time, no runtime dependencykroki-default-format: svg# kroki-server-url: https://kroki.io # default; set to self-hosted if desired
3. Paired change in neo4j-agent-integrations (separate PR, I'll handle it): change the converter to emit real diagram blocks instead of pre-encoded URLs:
[mermaid,my-diagram,svg]....flowchart LR user["User"] --> agent["Copilot Studio agent"]....
Sequencing
The two changes are not independent — [mermaid] blocks render as literal text if the extension isn't registered. Order:
Merge this docs-refresh change first (harmless on its own: no page uses [mermaid] blocks yet, so it's a no-op).
Then merge the converter change in neo4j-agent-integrations.
Rollback is symmetric: revert the converter change and the pre-encoded URLs come back.
Verification
npm install
npx antora --fetch developer.yml
# then confirm, for each of the 5 pages above:# - diagram <img> src is a LOCAL path, not https://kroki.io/...# - the SVG file exists in build/site/# - no "kroki" warnings in build output
Worth confirming during review: with kroki-fetch-diagram: true, the build machine needs outbound access to kroki.io at build time (it already needs network for npm install and Antora's content fetch). If that's unacceptable, the alternative is a self-hosted kroki via kroki-server-url.
Alternatives considered
Option
Verdict
Keep pre-encoded kroki URLs (status quo)
Works, zero build deps. Costs a page-view-time third-party dependency and unreviewable diagram source
Summary
Mermaid diagrams on the agent-integration pages are currently baked into pre-encoded
kroki.ioimage URLs at Markdown→AsciiDoc conversion time. This works, but it makes every diagram a third-party runtime dependency at page-view time and leaves the diagram source unreadable in the.adoc. Adding theasciidoctor-krokiextension withkroki-fetch-diagramwould render diagrams at build time into local site assets instead.Current state
The pages under
genai-ecosystem/genai-frameworks/are generated from Markdown READMEs inneo4j-labs/neo4j-agent-integrationsbyscripts/publish-to-labs.py. Mermaid fenced blocks are deflate+base64-encoded into a URL:image::https://kroki.io/mermaid/svg/eNp1UE1LAzEQvfsrhjltkcWLRymse1VbLJ5CD9lmaiNpZkk...[Diagram,align="center"]Neither
developer.ymlnorlabs.ymlregisters a diagram extension today — onlyremote-includeandmacros— so this pre-encoding is what makes the diagrams work at all.Pages currently relying on it (5):
microsoft-foundry.adocmicrosoft-foundry/README.mdmicrosoft-agent-framework.adocmicrosoft-agent-framework/README.mdmicrosoft-agent-framework-multi-agent.adocmicrosoft-agent-framework/examples/multi-agent/README.mddatarobot.adocdatarobot/README.mdmicrosoft-copilot-studio.adocmicrosoft-copilot-studio/README.mdWhy change it
kroki.ioon page load. If it is down, rate-limiting, or blocked by a corporate network, diagrams silently vanish from published docs..adoc. The encoded blob is opaque — not reviewable in a PR diff, not greppable, not editable without re-running the converter.Proposed change
1.
package.json— add todevDependencies:Important
Pin to the
0.18.xline — do not uselatest.asciidoctor-kroki@1.0.1declarespeerDependencies: { "@asciidoctor/core": ">=4.0.0 <5.0.0" }, but Antora 3.1 resolves@asciidoctor/core: ~2.2. Only0.18.1(>=2.2 <4.0) is compatible with the current Antora version. This becomes upgradable when the repo moves to Antora 4.x.2.
developer.ymlandlabs.yml— both sourcelabs-pages@publish, so both need it:3. Paired change in
neo4j-agent-integrations(separate PR, I'll handle it): change the converter to emit real diagram blocks instead of pre-encoded URLs:Sequencing
The two changes are not independent —
[mermaid]blocks render as literal text if the extension isn't registered. Order:[mermaid]blocks yet, so it's a no-op).neo4j-agent-integrations.Rollback is symmetric: revert the converter change and the pre-encoded URLs come back.
Verification
Worth confirming during review: with
kroki-fetch-diagram: true, the build machine needs outbound access tokroki.ioat build time (it already needs network fornpm installand Antora's content fetch). If that's unacceptable, the alternative is a self-hosted kroki viakroki-server-url.Alternatives considered
asciidoctor-kroki+kroki-fetch-diagram(this proposal)asciidoctor-diagrammermaid.jsFiled from work on the agent-integration publication pipeline. Happy to open the PR for both repos if this direction is agreed.