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

@kmblcmkj/blmarkdown

v0.0.4

Published

bl Markdown component with support for images, math formulas, tables, and code highlighting

Readme

blmarkdown

Vue3 Markdown 组件,支持图片、数学公式、表格、代码高亮和流程图渲染。

功能特性

  • ✅ Markdown 基本语法支持
  • ✅ 数学公式渲染(KaTeX)
  • ✅ 代码高亮(highlight.js)
  • ✅ 行号显示
  • ✅ 流程图渲染(Mermaid.js)
  • ✅ 表格渲染
  • ✅ 图片显示
  • ✅ 响应式设计

安装

npm install @kmblcmkj/[email protected]

使用方法

方法 1:在单个组件中按需引入

<template>
  <div>
    <bl-markdown :source="markdownContent" />
  </div>
</template>

<script setup>
import BlMarkdown from '@kmblcmkj/blmarkdown'

const markdownContent = `# 标题

内容...`
</script>

方法 2:在全局注册组件

main.tsmain.js 中:

import { createApp } from 'vue'
import App from './App.vue'
import BlMarkdown from '@kmblcmkj/blmarkdown'

const app = createApp(App)
app.component('BlMarkdown', BlMarkdown) // 全局注册
app.mount('#app')

然后在任意组件中直接使用:

<template>
  <div>
    <bl-markdown :source="markdownContent" />
  </div>
</template>

<script setup>
const markdownContent = `# 标题
内容...`
</script>

Markdown 语法示例

1. 基础语法

# 一级标题
## 二级标题
### 三级标题

**粗体**、*斜体*、***粗斜体***

[链接文本](链接地址)
![图片描述](图片地址)

> 引用文本

- 无序列表项
1. 有序列表项

\`行内代码\`

---

2. 代码块

```javascript
const hello = () => {
  console.log('Hello, World!')
}
interface User {
  name: string
  age: number
}

### 3. 数学公式

**行内公式**:
```markdown
$E = mc^2$

块级公式

$$
\int_0^1 x^2 dx = \frac{1}{3}
$$

$$
\sum_{i=1}^n i = \frac{n(n+1)}{2}
$$

4. 表格

| 名称 | 描述 | 版本 |
|------|------|------|
| Vue  | 前端框架 | 3.x |
| React | 前端库 | 18.x |

| 左对齐 | 居中对齐 | 右对齐 |
| :--- | :---: | ---: |
| 文本 | 文本 | 文本 |

5. 流程图

```mermaid
graph TD
  A[开始] --> B[处理]
  B --> C{判断}
  C -->|是| D[结果1]
  C -->|否| E[结果2]
  D --> F[结束]
  E --> F

## 完整示例

```vue
<template>
  <div class="container">
    <bl-markdown :source="markdownContent" />
  </div>
</template>

<script setup>
import BlMarkdown from '@kmblcmkj/blmarkdown'

const markdownContent = `# Vue3 Markdown 组件测试

## 基础语法
### 标题
# 一级标题
## 二级标题
### 三级标题

### 强调
**粗体**、*斜体*、***粗斜体***

### 链接
[Vue.js 官方网站](https://vuejs.org)

### 图片
![Vue Logo](https://vuejs.org/images/logo.png)

## 代码块
\`\`\`javascript
const hello = () => {
  console.log('Hello, World!')
}
\`\`\`

## 数学公式
### 行内公式
$E = mc^2$ 是爱因斯坦的质能方程

### 块级公式
$$
\int_0^1 x^2 dx = \frac{1}{3}
$$

## 表格
| 名称 | 描述 | 版本 |
|------|------|------|
| Vue  | 前端框架 | 3.x |
| React | 前端库 | 18.x |

## 流程图
\`\`\`mermaid
graph TD
  A[开始] --> B[处理]
  B --> C{判断}
  C -->|是| D[结果1]
  C -->|否| E[结果2]
  D --> F[结束]
  E --> F
\`\`\`
`
</script>

<style>
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}
</style>

依赖

  • Vue 3.x
  • highlight.js
  • katex
  • markdown-it
  • mermaid

版本更新

  • v0.1.1: 初始版本

许可证

ISC

作者

sssllg