halo-sigs / plugin-text-diagram

为默认编辑器和文章渲染提供文本绘图支持。
GNU General Public License v3.0
5 stars 1 forks source link

feat: Choosing an implementation solution for PlantUML #7

Closed xinkeng0 closed 3 weeks ago

xinkeng0 commented 10 months ago

Since version 1.0, this plugin has been able to support PlantUML and Mermaid. However, I have some thoughts on the implementation of PlantUML.

The current implementation method is pure JavaScript, which requires dependency on a PlantUML server (official server).

I believe there are several ways to improve:

  1. Retain the current implementation method, but allow users to utilize their own PlantUML server. We simply need to use ServerUrl as a plugin configuration item.

  2. Employ plantuml.js to operate entirely on the browser without the need for a server.

    PlantUML that operates entirely on the browser without the need for a server.

    Technically, this is not an issue as I have constructed a well-functioning demo based on this library. The challenge in choosing this solution is that it relies on a Java virtual machine called CheerJ to function.This may be overly complex for the end user.

    CheerpJ is a WebAssembly-based Java Virtual Machine for the browser. It has extensive compatibility with Java 8 and provides a full runtime environment1 for running Java applications, applets, libraries, and Java Web Start / JNLP applications in the browser without plugins.

xinkeng0 commented 10 months ago

Speaking solely from my personal perspective, I am more inclined towards Plan 1. Because for now, it’s simple enough.

ruibaby commented 10 months ago

Speaking solely from my personal perspective, I am more inclined towards Plan 1. Because for now, it’s simple enough.

+1