Skip to content

Commit b44d00c

Browse files
author
ReAlign
committed
re:update README
1 parent d8d2aa1 commit b44d00c

File tree

3 files changed

+88
-85
lines changed

3 files changed

+88
-85
lines changed

README.md

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# fastpage
22

3-
[中文说明](https://github.com/ReAlign/fastpage/blob/master/README_zh.md)
3+
[英文说明](https://github.com/ReAlign/fastpage/blob/master/README_en.md)
44

55
[![NPM travis][travis-image]][github-url]
66
[![codebeat badge][codebeat-image]][codebeat-url]
@@ -45,67 +45,67 @@
4545
<!-- [issues-image]: https://img.shields.io/github/issues/ReAlign/fastpage.svg
4646
[issues-url]: https://github.com/ReAlign/fastpage/issues -->
4747

48-
## Condition
48+
## 要求
4949

5050
* node version:≥v7.6.0
5151

52-
## Introduction
52+
## 简介
5353

54-
A tool to quickly generate front-end pages and associated files
54+
快速生成前端页面和相关文件的工具
5555

56-
* [x] a lot of repetitive work is done when creating a new page
57-
* [x] according to the configuration generated folder structure
58-
* [x] support multiple page (folder) types, configurable
59-
* [x] built-in replacement rules, can be extended
60-
* [ ] other (requirements customization)
56+
* [x] 创建新页面时的大量重复工作
57+
* [x] 根据配置生成文件夹结构
58+
* [x] 支持多种页面(文件夹)类型,可配置
59+
* [x] 内置替换规则,可扩展
60+
* [x] 动态替换规则,实时输入命令时动态替换
61+
* [ ] 其他(需求定制)
6162

62-
## Install & run
63+
## 安装 & 运行
6364

6465
```
6566
$ npm install fastpage -g
6667
```
6768

68-
At project root directory, and run:
69+
在项目根目录, 执行:
6970

70-
#### init config file
71+
#### 初始化配置文件
7172
```
7273
$ fp -i
7374
```
74-
#### create main page folder and associated files
75+
#### 创建主文件夹及相关文件
7576
```
76-
// just fp , also you can run: fp -r page(page config list must exist)
77+
// 你可以直接执行 fp , 当然你也可以执行全命令: fp -r page(page 这个配置必须存在)
7778
$ fp
7879
```
7980

80-
#### create page with config list
81+
#### 根据配置列表生成文件夹及相关文件
8182
```
82-
// is the configuration that exists in the configuration list
83+
// modal 是配置列表中存在的配置
8384
$ fp -r modal
8485
```
8586

86-
#### need to pay attention to the input name
87+
#### 最后输入名称需要注意
8788

8889
```javascript
8990
$ input new page name (index): a/entry
9091
```
91-
* this place will be as follows:
92-
* when path2 already exist, `path a` will be spell into the path, but will not change file name, the name of configuration shall prevail(the follow-up to optimize
92+
* 这个地方会进行如下处理:
93+
* path2 的时候, `路径a` 会被拼进路径中,但是文件名称不会变,以配置中的名称为准(后续会优化
9394

94-
## Configuration
95+
## 配置
9596

96-
`fastpage.config.js` sample:
97+
`fastpage.config.js` 示例:
9798

9899
```javascript
99100
var config = {
100101
page: {
101-
tempPath: 'template', // The template folder path, relative to the configuration file
102+
tempPath: 'template', // 模板文件夹路径,相对于配置文件
102103
list: [
103104
{
104-
key: 'ftl', // file key
105-
path: 'view', // This file generates the path relative to the configuration file
106-
tempPath: ['index.ftl'], //The file template path relative to the template folder path
107-
name: ['index.ftl'] // For the name of the generated file, tempPath & name has multiple
108-
// and the array location needs to correspond
105+
key: 'ftl', // 文件 key
106+
path: 'view', // 该文件生成路径,相对于配置文件
107+
tempPath: ['index.ftl'], // 该文件模板路径,相对于模板文件夹的路径
108+
name: ['index.ftl'] // 待生成文件的名字,tempPath & name 有多个的话,数组位置需对应
109109
},
110110
{
111111
key: 'mcss',
@@ -122,22 +122,22 @@ var config = {
122122
{
123123
key: 'jsCom',
124124
path: 'javascript',
125-
path2: 'components', // some file paths depend on newly created folder 'folder'
126-
// and path2 is spliced in the back of 'folder'
125+
path2: 'components', // 有些文件的路径是依赖新建的文件夹folder的,path2会拼接在folder后面
127126
tempPath: ['components/index.js', 'components/config.js', 'components/index.html'],
128127
name: ['index.js', 'config.js', 'index.html']
129128
}
130129
],
131-
// usually a level one menu has a mcss
132-
// also you can create one mcss per page
130+
// 通常每个一级目录使用一个 mcss 样式文件
131+
// 当然你也可以给每个页面均配置一个 mcss
133132
mcssTopLevel: true,
134-
// fastpage built-in some replacement rules
135-
// you can customize your own replacement rules
133+
// fastpage 内置了一些替换规则
134+
// 你可以定制自己的替换规则
136135
replaceList: [
137136
{
138-
rex: '~value~', // strings to be replaced (regular expressions)
139-
global: true, // global flag
140-
str: 'replace value' // string to replace
137+
dynamic: true, // 是否在输入命令时动态替换
138+
rex: '~value~', // 带替换字符串 / 正则表达式
139+
global: true, // 是不是全局替换
140+
str: 'replace value' // 替换之后的字符串:dynamic=true 时 是建议值
141141
}
142142
]
143143
},
@@ -160,12 +160,12 @@ var config = {
160160
module.exports = config;
161161
```
162162

163-
# cli
163+
# 命令
164164

165165
```
166-
-v, --version, print version
167-
-i, --init, create fastpage.config.js
168-
-c, --create, create the structure as configured
169-
-r, --run, create page folder and associated files
170-
-h, --help, print help
171-
```
166+
-v, --version, 输出版本
167+
-i, --init, 创建 fastpage.config.js 配置文件
168+
-c, --create, 根据配置创建目录结构
169+
-r, --run, 创建页面文件夹及相关文件
170+
-h, --help, 帮助
171+
```

README_zh.md renamed to README_en.md

Lines changed: 44 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# fastpage
22

3-
[英文说明](https://github.com/ReAlign/fastpage/blob/master/README.md)
3+
[中文说明](https://github.com/ReAlign/fastpage/blob/master/README.md)
44

55
[![NPM travis][travis-image]][github-url]
66
[![codebeat badge][codebeat-image]][codebeat-url]
@@ -45,66 +45,68 @@
4545
<!-- [issues-image]: https://img.shields.io/github/issues/ReAlign/fastpage.svg
4646
[issues-url]: https://github.com/ReAlign/fastpage/issues -->
4747

48-
## 要求
48+
## Condition
4949

5050
* node version:≥v7.6.0
5151

52-
## 简介
52+
## Introduction
5353

54-
快速生成前端页面和相关文件的工具
54+
A tool to quickly generate front-end pages and associated files
5555

56-
* [x] 创建新页面时的大量重复工作
57-
* [x] 根据配置生成文件夹结构
58-
* [x] 支持多种页面(文件夹)类型,可配置
59-
* [x] 内置替换规则,可扩展
60-
* [ ] 其他(需求定制)
56+
* [x] a lot of repetitive work is done when creating a new page
57+
* [x] according to the configuration generated folder structure
58+
* [x] support multiple page (folder) types, configurable
59+
* [x] built-in replacement rules, can be extended
60+
* [x] dynamic replacement rules,dynamic replacement when entering the command
61+
* [ ] other (requirements customization)
6162

62-
## 安装 & 运行
63+
## Install & run
6364

6465
```
6566
$ npm install fastpage -g
6667
```
6768

68-
在项目根目录, 执行:
69+
At project root directory, and run:
6970

70-
#### 初始化配置文件
71+
#### init config file
7172
```
7273
$ fp -i
7374
```
74-
#### 创建主文件夹及相关文件
75+
#### create main page folder and associated files
7576
```
76-
// 你可以直接执行 fp , 当然你也可以执行全命令: fp -r page(page 这个配置必须存在)
77+
// just fp , also you can run: fp -r page(page config list must exist)
7778
$ fp
7879
```
7980

80-
#### 根据配置列表生成文件夹及相关文件
81+
#### create page with config list
8182
```
82-
// modal 是配置列表中存在的配置
83+
// is the configuration that exists in the configuration list
8384
$ fp -r modal
8485
```
8586

86-
#### 最后输入名称需要注意
87+
#### need to pay attention to the input name
8788

8889
```javascript
8990
$ input new page name (index): a/entry
9091
```
91-
* 这个地方会进行如下处理:
92-
* path2 的时候, `路径a` 会被拼进路径中,但是文件名称不会变,以配置中的名称为准(后续会优化
92+
* this place will be as follows:
93+
* when path2 already exist, `path a` will be spell into the path, but will not change file name, the name of configuration shall prevail(the follow-up to optimize
9394

94-
## 配置
95+
## Configuration
9596

96-
`fastpage.config.js` 示例:
97+
`fastpage.config.js` sample:
9798

9899
```javascript
99100
var config = {
100101
page: {
101-
tempPath: 'template', // 模板文件夹路径,相对于配置文件
102+
tempPath: 'template', // The template folder path, relative to the configuration file
102103
list: [
103104
{
104-
key: 'ftl', // 文件 key
105-
path: 'view', // 该文件生成路径,相对于配置文件
106-
tempPath: ['index.ftl'], // 该文件模板路径,相对于模板文件夹的路径
107-
name: ['index.ftl'] // 待生成文件的名字,tempPath & name 有多个的话,数组位置需对应
105+
key: 'ftl', // file key
106+
path: 'view', // This file generates the path relative to the configuration file
107+
tempPath: ['index.ftl'], //The file template path relative to the template folder path
108+
name: ['index.ftl'] // For the name of the generated file, tempPath & name has multiple
109+
// and the array location needs to correspond
108110
},
109111
{
110112
key: 'mcss',
@@ -121,21 +123,22 @@ var config = {
121123
{
122124
key: 'jsCom',
123125
path: 'javascript',
124-
path2: 'components', // 有些文件的路径是依赖新建的文件夹folder的,path2会拼接在folder后面
126+
path2: 'components', // some file paths depend on newly created folder 'folder'
127+
// and path2 is spliced in the back of 'folder'
125128
tempPath: ['components/index.js', 'components/config.js', 'components/index.html'],
126129
name: ['index.js', 'config.js', 'index.html']
127130
}
128131
],
129-
// 通常每个一级目录使用一个 mcss 样式文件
130-
// 当然你也可以给每个页面均配置一个 mcss
132+
// usually a level one menu has a mcss
133+
// also you can create one mcss per page
131134
mcssTopLevel: true,
132-
// fastpage 内置了一些替换规则
133-
// 你可以定制自己的替换规则
135+
// fastpage built-in some replacement rules
136+
// you can customize your own replacement rules
134137
replaceList: [
135138
{
136-
rex: '~value~', // 带替换字符串 / 正则表达式
137-
global: true, // 是不是全局替换
138-
str: 'replace value' // 替换之后的字符串
139+
rex: '~value~', // strings to be replaced (regular expressions)
140+
global: true, // global flag
141+
str: 'replace value' // string to replace
139142
}
140143
]
141144
},
@@ -158,12 +161,12 @@ var config = {
158161
module.exports = config;
159162
```
160163

161-
# 命令
164+
# cli
162165

163166
```
164-
-v, --version, 输出版本
165-
-i, --init, 创建 fastpage.config.js 配置文件
166-
-c, --create, 根据配置创建目录结构
167-
-r, --run, 创建页面文件夹及相关文件
168-
-h, --help, 帮助
169-
```
167+
-v, --version, print version
168+
-i, --init, create fastpage.config.js
169+
-c, --create, create the structure as configured
170+
-r, --run, create page folder and associated files
171+
-h, --help, print help
172+
```

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "fastpage",
3-
"version": "1.4.0",
3+
"version": "1.4.1",
44
"description": "a tool to quickly generate front-end pages and associated files",
55
"main": ".eslintrc.js",
66
"bin": {

0 commit comments

Comments
 (0)