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

@mini-dev/markdown-adapter-wechat

v0.0.1

Published

minidev-markdown 的微信小程序适配器 —— RenderIR 落到微信 rich-text 节点树 + 组件段 + inline 段

Readme

@mini-dev/markdown-adapter-wechat

@mini-dev/markdown-core 的微信小程序适配器 —— 把平台无关的 RenderIR 落到微信 rich-text 节点树 + 自定义组件段 + 可点击 inline 段。

core 只持端无关契约(PlatformAdapter/AdapterNode/MixedSegment 等),各端 adapter 独立成包。本包是微信端实现;支付宝 / 抖音 adapter 可按同构各自独立成包。

1. 特性

  • rich-text 节点树irToRichTextNodes(ir) → 微信 rich-text nodes
  • 混合渲染irToMixedSegments(ir) → 交替的 rich-text / component / inline 段,配合 md-view 容器按段分派。
  • 可换肤样式表createWeChatAdapter(components, styles?) 第二参覆盖 DEFAULT_WECHAT_STYLES;renderer props.style 仍优先。
  • 代码块横向滑动createWeChatAdapter(components, styles, { codeScroll: true }) 把 fenced code 单独成段,md-view<scroll-view scroll-x> 横滑。
  • 失败可见降级:未注册组件 → [<Type> k=v] 文本占位,不静默吞。

2. 安装

npm i @mini-dev/markdown-core @mini-dev/markdown-adapter-wechat

小程序侧执行「工具 → 构建 npm」(读 "miniprogram": "dist/cjs")。

3. 用法

const { createMarkdown } = require('@mini-dev/markdown-core');
const { createWeChatAdapter } = require('@mini-dev/markdown-adapter-wechat');

const md = createMarkdown();
const adapter = createWeChatAdapter();
adapter.registry.register('md-math', '/components/md-math/index');

const blocks = md.parse(source);
const nodes = adapter.irToRichTextNodes(md.render(blocks));

流式见 core 的 MarkdownStream:每个 patch 经 adapter.irToMixedSegments(patch.instructions) 落到 md-view segments

4. 文档

5. License

MIT