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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@wenyan-md/cli

v1.0.6

Published

A CLI tool for Wenyan markdown rendering & publishing

Readme

文颜 CLI

npm License NPM Downloads Stars

「文颜」是一款多平台排版美化工具,让你将 Markdown 一键发布至微信公众号、知乎、今日头条等主流写作平台。

文颜现已推出多个版本:

本项目是 文颜的 CLI 版本

功能

  • 使用内置主题对 Markdown 内容排版
  • 支持图片自动上传
  • 支持数学公式渲染
  • 一键发布文章到微信公众号草稿箱

主题效果

👉 内置主题预览

文颜采用了多个开源的 Typora 主题,在此向各位作者表示感谢:

安装

npm install -g @wenyan-md/cli

基本用法

主命令为:

wenyan <command> [options]

环境变量

某些功能(如发布到微信公众号)需要配置以下环境变量:

  • WECHAT_APP_ID
  • WECHAT_APP_SECRET

macOS / Linux

可在命令前临时设置:

WECHAT_APP_ID=xxx WECHAT_APP_SECRET=yyy wenyan publish "your markdown"

或在 ~/.bashrc / ~/.zshrc 中永久添加:

export WECHAT_APP_ID=xxx
export WECHAT_APP_SECRET=yyy

Windows (PowerShell)

临时设置:

$env:WECHAT_APP_ID="xxx"; $env:WECHAT_APP_SECRET="yyy"; wenyan publish "your markdown"

永久设置(在环境变量里添加):

控制面板 → 系统和安全 → 系统 → 高级系统设置 → 环境变量 → 添加 WECHAT_APP_IDWECHAT_APP_SECRET

子命令

publish

将 Markdown 转换为适配微信公众号的富文本 HTML 并上传到公众号。

参数

  • <input-content>,要转换的 Markdown 内容。可直接作为参数传入,或通过管道/重定向从 stdin 读取

选项

  • -t,主题id,默认default
    • default
    • orangeheart
    • rainbow
    • lapis
    • pie
    • maize
    • purple
    • phycat
  • -h,代码高亮主题,默认solarized-light
    • atom-one-dark
    • atom-one-light
    • dracula
    • github-dark
    • github
    • monokai
    • solarized-dark
    • solarized-light
    • xcode
  • 代码块默认使用 Mac 风格,如要关闭:--no-mac-style
  • 链接默认转脚注,如要关闭:--no-footnote

示例

直接传入内容:

wenyan publish "# Hello, Wenyan" -t lapis -h solarized-light

从文件读取:

cat example.md | wenyan publish -t lapis -h solarized-light --no-mac-style

微信公众号 IP 白名单

请务必将服务器 IP 加入公众号平台的 IP 白名单,以确保上传接口调用成功。 详细配置说明请参考:https://yuzhi.tech/docs/wenyan/upload

配置说明(Frontmatter)

为了可以正确上传文章,需要在每一篇 Markdown 文章的开头添加一段frontmatter,提供titlecover两个字段:

---
title: 在本地跑一个大语言模型(2) - 给模型提供外部知识库
cover: /Users/lei/Downloads/result_image.jpg
---
  • title 是文章标题,必填。

  • cover 是文章封面,支持本地路径和网络图片:

    • 如果正文有至少一张图片,可省略,此时将使用其中一张作为封面;
    • 如果正文无图片,则必须提供 cover。

关于图片自动上传

  • 支持图片路径:

    • 本地路径(如:/Users/lei/Downloads/result_image.jpg
    • 网络路径(如:https://example.com/image.jpg

示例文章格式

---
title: 在本地跑一个大语言模型(2) - 给模型提供外部知识库
cover: /Users/lei/Downloads/result_image.jpg
---

在[上一篇文章](https://babyno.top/posts/2024/02/running-a-large-language-model-locally/)中,我们展示了如何在本地运行大型语言模型。本篇将介绍如何让模型从外部知识库中检索定制数据,提升答题准确率,让它看起来更“智能”。

## 准备模型

访问 `Ollama` 的模型页面,搜索 `qwen`,我们使用支持中文语义的“[通义千问](https://ollama.com/library/qwen:7b)”模型进行实验。

![](https://mmbiz.qpic.cn/mmbiz_jpg/Jsq9IicjScDVUjkPc6O22ZMvmaZUzof5bLDjMyLg2HeAXd0icTvlqtL7oiarSlOicTtiaiacIxpVOV1EeMKl96PhRPPw/640?wx_fmt=jpeg)

赞助

如果您觉得不错,可以给我家猫咪买点罐头吃。喂猫❤️

License

Apache License Version 2.0