Skip to content

Commit 28611d6

Browse files
Update the embedded Kroki extension to asciidoctor-kroki 2.0.0.rc.3 (#516) (#2111)
kroki-extension.rb is now the gem's version.rb, preprocess.rb, cache.rb and extension.rb concatenated into one loadable script, with the plugin's three local changes (header, "-intellij" referer suffix, registration block). PlantUML !include, !includesub, !include_once, !include_many and !includeurl are resolved before the diagram is sent to Kroki: relative to the diagram file of the block macro, then to each kroki-plantuml-include-paths entry; http(s) includes are fetched and inlined, only <stdlib> passes through. The Kroki server otherwise drops a local include it cannot read and renders a degraded diagram without warning. A failed diagram no longer aborts the document, and block macro targets resolve relative to the document. Tests decode the generated Kroki URL and assert the included text is inlined, for a macro target and for an inline block using kroki-plantuml-include-paths. Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
1 parent a7d0047 commit 28611d6

4 files changed

Lines changed: 681 additions & 66 deletions

File tree

‎CHANGELOG.adoc‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ This document provides a high-level view of the changes introduced by release.
99

1010
=== 0.45.7
1111

12-
...
12+
- Update the embedded Kroki extension to asciidoctor-kroki 2.0.0.rc.3: PlantUML `!include`, `!includesub`, `!include_once`, `!include_many` and `!includeurl` directives (relative to the diagram file, plus `kroki-plantuml-include-paths`) are now resolved before the diagram is sent to Kroki, a failed diagram no longer aborts the page, and block macro targets resolve relative to the document (#516)
1313

1414
=== 0.45.6
1515

‎doc/users-guide/modules/ROOT/pages/features/preview/diagrams.adoc‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,18 @@ To avoid this, consider using `interactive` for Kroki diagrams as an alternative
111111
See <<interative-vs-inlined>> and <<avoid-flicker>> for a discussion of tradeoffs.
112112
====
113113

114+
=== PlantUML includes with Kroki
115+
116+
The Kroki server has no access to the local file system, so the plugin resolves PlantUML
117+
`+!include+`, `+!includesub+`, `+!include_once+`, `+!include_many+` and `+!includeurl+` directives
118+
before the diagram is sent (plugin version 0.45.7+, using the include preprocessor of
119+
asciidoctor-kroki 2.0).
120+
Relative include paths resolve against the directory of the `.puml` file referenced by the block macro,
121+
then against each directory in the `kroki-plantuml-include-paths` attribute; `http(s)` includes are fetched
122+
and inlined as well, only `+<stdlib>+` includes are passed through to the server.
123+
Diagrams written inline in a `[plantuml]` block have no file location, so only absolute paths and the
124+
`kroki-plantuml-include-paths` directories work for their includes.
125+
114126
== Using embedded Mermaid support
115127

116128
As an experimental option in plugin version 0.38.1+, there's an embedded Mermaid support that is embedded in the plugin and will render Mermaid diagrams within the IDE without external helpers.

0 commit comments

Comments
 (0)