@shawnxie666/md-cli
v2.1.4
Published
WeChat Markdown Editor | 一款高度简洁的微信 Markdown 编辑器:支持 Markdown 语法、自定义主题样式、内容管理、多图床、AI 助手等特性
Readme
md-cli
A powerful yet simple tool for rendering Markdown documents locally during development.
Installation
To get started with md-cli, you can install it either globally or locally, depending on your needs.
Install locally
If you only need it for a specific project, you can install it locally by running:
npm install @shawnxie666/md-cliInstall globally
For global access across all your projects, install it globally with:
npm install -g @shawnxie666/md-cliUsage
Once installed, running md-cli is a breeze. Here’s how to get started:
Render Markdown for WeChat
Render a Markdown file to WeChat Official Account-compatible HTML:
md-cli render input.md --output output.htmlPrint to stdout:
md-cli render input.md --stdoutThe render command supports runtime style options:
md-cli render input.md --output output.html \
--theme grace \
--font-family sans \
--font-size recommended \
--primary-color classic-blue \
--heading-style default \
--code-theme idea \
--legend none \
--mac-code-block false \
--line-numbers false \
--cite false \
--indent false \
--justify trueSupported aliases:
--theme:default,grace,simple--font-family:sans,serif,mono, or a CSS font-family value--font-size:recommended,14px,15px,16px,17px,18px--primary-color:classic-blue, Chinese color labels such as经典蓝, or a CSS color value--heading-style:default,color-only,border-bottom,border-left--code-theme: a highlight.js theme name such asidea,github,xcode, or a CSS URL--legend:none,alt,title,filename, or a combined legend expression
Default setup
To launch md-cli with the default settings, simply run:
md-cliCustom port
If you prefer to run md-cli on a different port, say 8899, just specify it like this:
md-cli port=8899