Skip to content

为默认编辑器和文章渲染提供文本绘图支持。

License

Notifications You must be signed in to change notification settings

halo-sigs/plugin-text-diagram

Repository files navigation

文本绘图

为 Halo 2 的默认编辑器和文章渲染提供文本绘图(Mermaid & PlantUML)支持。

Text Diagram

使用方式

  1. 下载,目前提供以下两个下载方式:
  2. 安装,插件安装和更新方式可参考:https://docs.halo.run/user-guide/plugins

用法说明

默认编辑器

可以在指令菜单(/)中找到 文本绘图 菜单项,选择即可插入新的文本绘图块。

文章页渲染

此插件安装之后,支持渲染文本绘图。

配置项:

  1. mermaid_selector

    CSS-Selector语法,用来查找渲染的mermaid-Dom。

    默认值为:text-diagram[data-type="mermaid"](本插件扩展默认编辑器生成的行内公式Dom),如需兼容其他编辑器,则设置为相应的Selector即可(CSS-Selector支持或,,分隔即可)

    example:.class1,.class2

开发环境

git clone git@github.com:halo-sigs/plugin-text-diagram.git

# 或者当你 fork 之后

git clone git@github.com:{your_github_id}/plugin-text-diagram.git
cd path/to/plugin-text-diagram
# macOS / Linux
./gradlew pnpmInstall

# Windows
./gradlew.bat pnpmInstall
# macOS / Linux
./gradlew build

# Windows
./gradlew.bat build

修改 Halo 配置文件:

halo:
  plugin:
    runtime-mode: development
    classes-directories:
      - "build/classes"
      - "build/resources"
    lib-directories:
      - "libs"
    fixedPluginPath:
      - "/path/to/plugin-text-diagram"