mirror of
https://github.com/doocs/md.git
synced 2025-01-22 20:04:39 +08:00
docs: update cli readme guideline (#464)
This commit is contained in:
parent
79477702d2
commit
3e81b866fd
16
README.md
16
README.md
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
<div align="center">
|
<div align="center">
|
||||||
|
|
||||||
[![status](https://img.shields.io/github/actions/workflow/status/doocs/md/build.yml?style=flat-square&labelColor=564341&color=42cc23)](https://github.com/doocs/md/actions) [![node](https://img.shields.io/badge/node-%3E%3D20-42cc23?style=flat-square&labelColor=564341)](https://nodejs.org/en/about/previous-releases) [![release](https://img.shields.io/github/v/release/doocs/md?style=flat-square&labelColor=564341&color=42cc23)](https://github.com/doocs/md/releases) [![license](https://img.shields.io/github/license/doocs/md?style=flat-square&labelColor=564341&color=42cc23)](./LICENSE) [![pr](https://img.shields.io/badge/prs-welcome-42cc23?style=flat-square&labelColor=564341)](https://github.com/doocs/md/pulls)<br>[![stars](https://img.shields.io/github/stars/doocs/md?style=flat-square&labelColor=564341&color=42cc23)](https://github.com/doocs/md/stargazers) [![forks](https://img.shields.io/github/forks/doocs/md?style=flat-square&labelColor=564341&color=42cc23)](https://github.com/doocs/md)
|
[![status](https://img.shields.io/github/actions/workflow/status/doocs/md/build.yml?style=flat-square&labelColor=564341&color=42cc23)](https://github.com/doocs/md/actions) [![node](https://img.shields.io/badge/node-%3E%3D20-42cc23?style=flat-square&labelColor=564341)](https://nodejs.org/en/about/previous-releases) [![pr](https://img.shields.io/badge/prs-welcome-42cc23?style=flat-square&labelColor=564341)](https://github.com/doocs/md/pulls) [![stars](https://img.shields.io/github/stars/doocs/md?style=flat-square&labelColor=564341&color=42cc23)](https://github.com/doocs/md/stargazers) [![forks](https://img.shields.io/github/forks/doocs/md?style=flat-square&labelColor=564341&color=42cc23)](https://github.com/doocs/md)<br> [![release](https://img.shields.io/github/v/release/doocs/md?style=flat-square&labelColor=564341&color=42cc23)](https://github.com/doocs/md/releases) [![npm](https://img.shields.io/npm/v/@doocs/md-cli?style=flat-square&labelColor=564341&color=42cc23)](https://www.npmjs.com/package/@doocs/md-cli) [![docker](https://img.shields.io/badge/docker-latest-42cc23?style=flat-square&labelColor=564341)](https://hub.docker.com/r/doocs/md)
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -78,19 +78,19 @@ Markdown 文档自动即时渲染为微信图文,让你不再为微信文章
|
|||||||
示例代码:
|
示例代码:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
const { file, util, okCb, errCb } = CUSTOM_ARG
|
const { file, util, okCb, errCb } = CUSTOM_ARG;
|
||||||
const param = new FormData()
|
const param = new FormData();
|
||||||
param.append(`file`, file)
|
param.append(`file`, file);
|
||||||
util.axios
|
util.axios
|
||||||
.post(`http://127.0.0.1:9000/upload`, param, {
|
.post(`http://127.0.0.1:9000/upload`, param, {
|
||||||
headers: { 'Content-Type': `multipart/form-data` },
|
headers: { "Content-Type": `multipart/form-data` },
|
||||||
})
|
})
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
okCb(res.url)
|
okCb(res.url);
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
errCb(err)
|
errCb(err);
|
||||||
})
|
});
|
||||||
|
|
||||||
// 提供的可用参数:
|
// 提供的可用参数:
|
||||||
// CUSTOM_ARG = {
|
// CUSTOM_ARG = {
|
||||||
|
50
md-cli/README.md
Normal file
50
md-cli/README.md
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
# 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:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm install @doocs/md-cli
|
||||||
|
```
|
||||||
|
|
||||||
|
### Install globally
|
||||||
|
|
||||||
|
For global access across all your projects, install it globally with:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm install -g @doocs/md-cli
|
||||||
|
```
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
Once installed, running `md-cli` is a breeze. Here’s how to get started:
|
||||||
|
|
||||||
|
### Default setup
|
||||||
|
|
||||||
|
To launch `md-cli` with the default settings, simply run:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
md-cli
|
||||||
|
```
|
||||||
|
|
||||||
|
### Custom port
|
||||||
|
|
||||||
|
If you prefer to run `md-cli` on a different port, say `8899`, just specify it like this:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
md-cli port=8899
|
||||||
|
```
|
||||||
|
|
||||||
|
## Maintainers
|
||||||
|
|
||||||
|
- [yanglbme](https://github.com/yanglbme) – Core maintainer.
|
||||||
|
- [YangFong](https://github.com/yangfong) – Core maintainer.
|
||||||
|
- [xw](https://github.com/wll8) – Contributor.
|
||||||
|
- [thinkasany](https://www.npmjs.com/~thinkerwing) – Contributor.
|
4
md-cli/package-lock.json
generated
4
md-cli/package-lock.json
generated
@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "@doocs/md-cli",
|
"name": "@doocs/md-cli",
|
||||||
"version": "0.0.8",
|
"version": "0.1.0",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@doocs/md-cli",
|
"name": "@doocs/md-cli",
|
||||||
"version": "0.0.8",
|
"version": "0.1.0",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@wll8/process-manager": "^1.0.1",
|
"@wll8/process-manager": "^1.0.1",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@doocs/md-cli",
|
"name": "@doocs/md-cli",
|
||||||
"version": "0.0.8",
|
"version": "0.1.0",
|
||||||
"description": "✍ 一款高度简洁的微信 Markdown 编辑器:支持 Markdown 所有基础语法、色盘取色、一键复制并粘贴到公众号后台、多图上传、一键下载文档、自定义 CSS 样式、一键重置等特性",
|
"description": "✍ 一款高度简洁的微信 Markdown 编辑器:支持 Markdown 所有基础语法、色盘取色、一键复制并粘贴到公众号后台、多图上传、一键下载文档、自定义 CSS 样式、一键重置等特性",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
Loading…
Reference in New Issue
Block a user