npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

gitbook-plugin-mermaid-svg

v1.0.1

Published

Mermaid SVG 渲染插件(GitBook 3 版,与 honkit-plugin-mermaid-svg 同代码)。构建时自动将 ```mermaid 代码块渲染为矢量图(website 输出 SVG / EPUB+PDF 输出 PNG)。

Readme

honkit-plugin-mermaid-svg

Mermaid 渲染插件,兼容 HonkitGitBook 3

构建时自动将 markdown 中的 ```mermaid 代码块渲染为图形:

  • website 构建 → 输出矢量 SVG(无限清晰)
  • EPUB / PDF 构建 → 输出 PNG(高兼容性,阅读器全支持)
  • 容器内直接调用全局 mmdcdocker-gitbook 镜像已内置),不依赖 npx 网络下载
  • 自动检测容器 /puppeteer-config.json(已含 --no-sandbox),无需手动创建

安装

npm install honkit-plugin-mermaid-svg

在 Docker 镜像(bloodstar/gitbook-builder)中使用

镜像已内置全部依赖,只需在 book.json 声明插件:

{
  "plugins": ["mermaid-svg"],
  "pluginsConfig": {
    "mermaid-svg": {
      "plugin": {
        "embed": false
      },
      "mermaid": {
        "theme": "neutral"
      }
    }
  }
}

构建时自动生效(无需额外安装步骤):

docker run --rm -v "$PWD":/workspace -w /workspace \
  bloodstar/gitbook-builder:latest \
  bash -c 'honkit epub && honkit pdf'

配置

  • pluginsConfig["mermaid-svg"].plugin.embed
    • true:website 构建时用 mermaid-cli 渲染 SVG 并嵌入
    • false(默认):website 构建时用浏览器端 Mermaid JS 直接渲染,EPUB/PDF 始终用 mermaid-cli
  • pluginsConfig["mermaid-svg"].mermaid
    • 透传给 mermaid-cli 的配置(如 theme),详见 Mermaid 主题

使用

在 markdown 中写 ```mermaid 代码块即可:

```mermaid
graph TD
    A[计划] --> B[组织]
    B --> C[控制]
```

兼容性

| 引擎 | website | epub | pdf | |------|---------|------|-----| | Honkit | ✅ | ✅ | ✅ | | GitBook 3 | ✅ | ✅ | ✅ |

Linux / Docker 说明

无需手动创建 puppeteer-config.json——插件自动检测:

  1. /puppeteer-config.json(容器内置,含 --no-sandbox
  2. 书根目录 puppeteer-config.json(可选,覆盖默认)

致谢

基于 intptr-t/honkit-plugin-mermaid-hybrid 改造。