Skip to content

Commit

Permalink
docs: vuepress build docs
Browse files Browse the repository at this point in the history
  • Loading branch information
webfansplz committed Nov 29, 2019
1 parent c0ff820 commit 931d311
Show file tree
Hide file tree
Showing 32 changed files with 345 additions and 1 deletion.
80 changes: 80 additions & 0 deletions docs/.vuepress/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
module.exports = {
base: '/null-cli/',
dest: 'docs/dist',
port: 3333,
serviceWorker: true,
locales: {
'/': {
lang: 'zh-CN',
title: 'Null-cli',
description: 'A command to free your hands',
},
},
head: [
[
'link',
{
rel: 'icon',
href: '/la-m.png',
},
],
[
'meta',
{
name: 'theme-color',
content: '#3eaf7c',
},
],
],
themeConfig: {
repo: 'webfansplz/null-cli',
editLinks: true,
docsDir: 'docs',
locales: {
'/': {
label: '简体中文',
selectText: '选择语言',
editLinkText: '在 GitHub 上编辑此页',
lastUpdated: '上次更新',
serviceWorker: {
updatePopup: {
message: '发现新内容可用',
buttonText: '刷新',
},
},
nav: [
// {
// text: '文档',
// link: '/API/install.html'
// }
],
},
},
sidebar: {
'/guide/': [
{
title: '使用指南',
collapsable: false,
children: ['install', 'introduce', 'use'],
},
{
title: '命令',
collapsable: false,
children: [
'fetch',
'youdao',
'open',
'qrcode',
'regex',
'random',
'create',
'day',
'serve',
'enc',
'dec',
],
},
],
},
},
}
Binary file added docs/.vuepress/public/aes.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/.vuepress/public/create-koa.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/.vuepress/public/day.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/.vuepress/public/enc.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/.vuepress/public/fetch.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/.vuepress/public/la-m.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/.vuepress/public/null-command.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/.vuepress/public/null-star.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/.vuepress/public/null.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/.vuepress/public/qrcode.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/.vuepress/public/random.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/.vuepress/public/regex.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/.vuepress/public/serve.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/.vuepress/public/star-m.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/.vuepress/public/youdao.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
home: true
heroImage: /null.png
actionText: 开始使用
actionLink: /guide/install.html

footer: MIT Licensed | Copyright © 2019-present null
---
23 changes: 23 additions & 0 deletions docs/guide/create.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# 创建前端工程

```shell
$ null create <probject-name>
```

![create](/create-koa.gif)

## 参数

- -f --force (Overwrite target directory if it exists)

## 模版类型

v1 提供了以下 4 类基础模版

- vue

- react

- koa

- active-page
20 changes: 20 additions & 0 deletions docs/guide/day.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# 日期格式转换

```shell
$ null day <params>
```

![day](/day.gif)

## 参数

| name | alias | 默认值 | 可选值 |
| :-: | :-: | :-: | :-: |
| -f | --format | YYYY-MM-DD HH:mm:ss | 同 moment.js |
| -t | --type | string | string(13 位时间戳->字符串),unix(字符串->13 位时间戳) |

```shell
null day 1574765068684 # 2019-11-26 18:44:28

null day "2020-01-01 18:18:18" -t unix # 1577873898000
```
35 changes: 35 additions & 0 deletions docs/guide/dec.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# 字符串解码/AES 解密

```shell
null dec <string>
```

![enc](/enc.gif)

![aes](/aes.gif)

## 字符串解码 参数

| name | alias | 默认值 | 可选值 |
| :--: | :------: | :----: | :--------: |
| -m | --method | base64 | base64,hex |

```shell

null dec bnVsbC1jbGk= # null-cli

null dec 6e756c6c2d636c69 -m hex # null-cli

```

## AES 解密 参数

| name | alias | 默认值 | 可选值 |
| :--: | :------: | :--------------: | :------------: |
| -m | --method | base64 | aes |
| -k | --key | 20201111nullbest | 任意 16 位字符 |
| -i | --iv | webbestlangworld | 任意 16 位字符 |

```shell
null dec b425ed8b1698de56aed3d1089ade239d -m aes # null-cli
```
37 changes: 37 additions & 0 deletions docs/guide/enc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# 字符串编码/AES 加密

```shell
null enc <string>
```

![enc](/enc.gif)

![aes](/aes.gif)

## 字符串编码 参数

| name | alias | 默认值 | 可选值 |
| :--: | :------: | :----: | :---------------------------------------------: |
| -m | --method | base64 | sha1,sha224,sha256,sha384,sha512,md5,base64,hex |

```shell
null enc null-cli # bnVsbC1jbGk=

null enc null-cli -m sha1 # a0071acf7a33712783545db8b4a7a89f0a35013d

null enc null-cli -m sha256 # fe8f4fa399ff4888b4d393c8dd09ba35385db71e12d627d83cc65d89ba83fc9b

null enc null-cli -m md5 # 91732209f7c84dd6119c81fd8b1a9669
```

## AES 加密 参数

| name | alias | 默认值 | 可选值 |
| :--: | :------: | :--------------: | :------------: |
| -m | --method | base64 | aes |
| -k | --key | 20201111nullbest | 任意 16 位字符 |
| -i | --iv | webbestlangworld | 任意 16 位字符 |

```shell
null enc null-cli -m aes # b425ed8b1698de56aed3d1089ade239d
```
9 changes: 9 additions & 0 deletions docs/guide/fetch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# 网络请求

```shell
$ null fetch <url>
```

目前只支持无头 get 请求 ~ (在命令行拼 header,body 感觉很繁琐,不如 postman 便捷)

![fetch](/fetch.gif)
13 changes: 13 additions & 0 deletions docs/guide/install.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# 安装

**NPM**

```shell
$ npm install null-cli -g
```

**YARN**

```shell
$ yarn add null-cli -g
```
13 changes: 13 additions & 0 deletions docs/guide/introduce.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# 介绍

![introduce](/null.png)

:man_technologist:在日常开发工作中,

我们经常会做一些重复性劳动,也经常需要在不同应用中来回切换。 :woman_technologist:

:star2:null-cli 的目标,当然不是没有蛀牙,

而是希望减少你使用 CV 大法的频率 , 避免你 Switch applications 的繁琐 。:punch:

:fire: We hope , A command frees your hands 。 :tada:
5 changes: 5 additions & 0 deletions docs/guide/open.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# 打开浏览器

```shell
$ null open <url>
```
7 changes: 7 additions & 0 deletions docs/guide/qrcode.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# 生成二维码

```shell
$ null qrcode <url>
```

![qrcode](/qrcode.gif)
7 changes: 7 additions & 0 deletions docs/guide/random.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# 生成随机数

```shell
$ null random <length>
```

![random](/random.gif)
27 changes: 27 additions & 0 deletions docs/guide/regex.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# 正则表达式

```shell
$ null regex
```

![regex](/regex.gif)

## 表达式列表

- 纯数字

- 纯汉字

- 纯英文字母

- 中文/英文/数字

- 日期格式(例:2019-11-11)

- 6-16 位数字字母组合

- 邮箱地址(email)

- ip 地址(v4)

- 邮政编码
14 changes: 14 additions & 0 deletions docs/guide/serve.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# 启动 web 服务器

```shell
null serve <path>
```

![serve](/serve.gif)

## 参数

| name | alias | 默认值 | 说明 |
| :--: | :----: | :----: | :----------------: |
| -p | --port | 8000 | 指定端口号 |
| -o | --open | false | 是否自动打开浏览器 |
3 changes: 3 additions & 0 deletions docs/guide/use.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# 使用

![use](/null-command.png)
41 changes: 41 additions & 0 deletions docs/guide/youdao.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# 有道翻译

```shell
null youdao <word>
```

![youdao](/youdao.gif)

```js

null youdao frontend
/**
Frontend workflows are a different thing than backend workflows.
前端工作流不同于后端工作流。
The user's client (frontend) application that wants to perform database operations.
那些需要执行数据库操作的用户的客户端(前端)应用。
The design of the classes are done in such a way that they have no relationship with, or dependency on, the frontend design or platform.
设计这些类的方式使得它们不依赖于前端设计或平台。
n. 前端
Frontend workflows are a different thing than backend workflows.
前端工作流不同于后端工作流。
The user's client (frontend) application that wants to perform database operations.
那些需要执行数据库操作的用户的客户端(前端)应用。
The design of the classes are done in such a way that they have no relationship with, or dependency on, the frontend design or platform.
设计这些类的方式使得它们不依赖于前端设计或平台。
**/
```

## 声明

这个 功能 借鉴了 [/~https://github.com/kenshinji/yddict](/~https://github.com/kenshinji/yddict)的实现。
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
"cz": "commitizen init cz-conventional-changelog --save --save-exact",
"version": "conventional-changelog -p angular -i CHANGELOG.md -s",
"lint": "eslint --fix lib/**/*.js bin/*.js utils/*.js",
"test": "nyc ava"
"test": "nyc ava",
"docs:dev": "vuepress dev docs",
"docs:build": "vuepress build docs"
},
"ava": {
"files": [
Expand Down

0 comments on commit 931d311

Please sign in to comment.