Skip to content

Add support for rendering inline PlantUML diagrams in the AsciiDoc preview and HTML export without requiring a Kroki server #1188

Description

@YoshihideShirai

Summary

Add support for rendering inline PlantUML diagrams in the AsciiDoc preview and HTML export without requiring a Kroki server.

Motivation

The extension already supports client-side rendering for Mermaid diagrams in preview. PlantUML diagrams currently rely on Kroki in many cases, which means users need a network-accessible Kroki server even for simple inline diagrams.

It would be useful to support [plantuml] blocks directly in the preview, similar to the approach used for Mermaid rendering, while keeping Kroki compatibility for existing diagram attributes and output structure.

Proposed Behavior

When Kroki is disabled, [plantuml] listing/literal blocks should render locally in the preview using @plantuml/core.

The generated preview HTML should stay compatible with the structure emitted by asciidoctor-kroki where practical, including:

  • block titles and figure captions
  • roles and Kroki-style format classes
  • kroki-default-format
  • kroki-plantuml-include
  • subs
  • custom block attributes/options

HTML export should also include browser-side PlantUML rendering by loading @plantuml/core from a CDN, so exported HTML can display PlantUML diagrams after opening in a browser.

Notes

PlantUML block macros such as plantuml::diagram.puml[] can remain handled by Kroki, since they require file/URL resolution behavior that differs from inline block rendering.

The renderer should avoid requiring JavaScript unsafe-eval; if WebAssembly support needs CSP adjustment in the VS Code preview, it should be scoped as narrowly as possible.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions