@akebifiky/remark-simple-plantuml

中文文档
1.0.2发布于 2020/12/15MITCommonJS近 30 天下载 1.4万

remark-simple-plantuml 是一个简单的插件 评论j 将用 Markdown 写的 PlantUML 代码转换为 img 标签.

中文使用文档
文档目录6 节
  1. 安装
  2. 示例
  3. 标记
  4. Java 脚本
  5. 插件选项
  6. 一体化

标记简单的 PlantUML 插件

Build Status MIT License

remark-simple-plantuml 是一个简单的插件 评论j 将 PlantUML 代码块转换成图像节点.

安装

npm install --save @akebifiky/remark-simple-plantuml

示例

您可以使用此插件, 如以下

标记

# Your markdown including PlantUML code block

```plantuml Your title
class SimplePlantUMLPlugin {
    + transform(syntaxTree: AST): AST
}
```

Java 脚本

const remark = require("remark");
const simplePlantUML = require("@akebifiky/remark-simple-plantuml");
const fs = require("fs");
const path = require("path");

const input = fs.readFileSync(path.resolve(__dirname, "./your-markdown.md")).toString();
const output = remark().use(simplePlantUML).processSync(input).toString();

console.log(output);
// will be 
// > # Your markdown including PlantUML code block
// >
// > ![Your title](https://www.plantuml.com/plantuml/png/Iyv9B2vM2CxCBSX93SX9p2i9zVK9o2bDpynJgEPI009jXPAYnBpYjFoYN8tYohoIn8gGejHKAmN7u11DCCbL2m00)

插件选项

您可以通过“ baseUrl” 选项使用特定的 PlantUML 服务器 . (默认为 https://www.plantuml.com/plantuml/png(中文(简体) )

如果您想要使用 SVG , 您可以像以下配置 .

remark().use(simplePlantUML, { baseUrl: "https://www.plantuml.com/plantuml/svg" }).processSync(input);

一体化

您可以在任何框架中使用此插件支持注释js .

如果你想在经典预设中使用 Docusaurus 2 定义和我一样,在您的配置 docusaurus.config.js 喜欢跟随.

const simplePlantUML = require("@akebifiky/remark-simple-plantuml");

// your configurations...

presets: [
    [
      "@docusaurus/preset-classic",
      {
        docs: {
          sidebarPath: require.resolve("./sidebars.js"),
          remarkPlugins: [simplePlantUML]
        }
      }
    ]
  ],

//...

版本与发布记录

@akebifiky/remark-simple-plantuml 共发布 3 个版本,首次发布于 2020/02/18;过去 12 个月发布了 0 个版本。

版本发布日期距今
1.0.2latest2020/12/155 年前
1.0.12020/02/186 年前
1.0.02020/02/186 年前

关于 @akebifiky/remark-simple-plantuml 的常见问题

@akebifiky/remark-simple-plantuml 是什么?

remark-simple-plantuml 是一个简单的插件 评论j 将用 Markdown 写的 PlantUML 代码转换为 img 标签.

如何安装 @akebifiky/remark-simple-plantuml?

在项目目录运行 npm install @akebifiky/remark-simple-plantuml,或使用 pnpm add / yarn add / bun add。

@akebifiky/remark-simple-plantuml 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/akebifiky__remark-simple-plantuml 是否存在。

@akebifiky/remark-simple-plantuml 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@akebifiky/remark-simple-plantuml 可以商用吗?

@akebifiky/remark-simple-plantuml 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@akebifiky/remark-simple-plantuml 的下载量有多少?

根据 npm 官方下载统计,@akebifiky/remark-simple-plantuml 在 2026/10/06 – 2026/11/04 这 30 天内被下载 13,517 次,日均约 451 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@akebifiky/remark-simple-plantuml 还在维护吗?

最新版本 1.0.2 发布于 2020/12/15(5 年前);至今共发布 3 个版本,其中过去 12 个月发布了 0 个;首次发布于 2020/02/18。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。