Skip to content

Commit 3b7e129

Browse files
wh131462SmallTeddy
andauthored
feat: change lf feature and update docs (#27)
* fix: delete hot100 add study plan list * fix: delete hot100 add study plan list * fix: change plan list question title to cn * fix: change plan list question title to cn * fix: get all is not success * fix: get all is not success * chore: pkg config * chore: del pkg config * chore: modify package.json * chore: modify code * chore: del some * * chore: modify docs * chore: del test hot 100 --------- Co-authored-by: SmallTeddy <zhangzeming1212@gmail.com>
1 parent 5672faa commit 3b7e129

13 files changed

+149
-120
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ resources/stores/*
3535
# cli-dist
3636
pl-cli
3737
*/colorFont.js
38+
pl-build
3839

3940
# package manager
4041
yarn.lock

README.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Then, `leetcode-practice` is all you need!
2525
### 0. Prerequisites
2626

2727
| Tool | Remarks |
28-
|----------|:-----------------------------------------------:|
28+
| -------- | :---------------------------------------------: |
2929
| nodejs | lts |
3030
| git | lts |
3131
| computer | Ability to run Chrome and a code editor |
@@ -230,15 +230,15 @@ npm i --save-dev leetcode-practice
230230
`KFC` is a simple mnemonic that can quickly remember our three core commands: `lk`, `lf`, and `lc`.
231231

232232
| Command | Explanation |
233-
|---------|-----------------------------------------------------------------------------------------------------------------------------------|
233+
| ------- | --------------------------------------------------------------------------------------------------------------------------------- |
234234
| lc | Core creation command, supports three creation modes (daily question, specified question, random question) for creating questions |
235235
| lk | Core checking command, supports three modes corresponding to the question for checking questions |
236236
| lf | Core search command, which can quickly search for the question you want based on prompts |
237237

238238
#### [1]. lc
239239

240240
| Short Parameter | Full Parameter | Explanation |
241-
|------------------------|----------------|-------------------------------------------------------------------------|
241+
| ---------------------- | -------------- | ----------------------------------------------------------------------- |
242242
| No parameter / `-t` | `--today` | Create today's daily question |
243243
| Question number / `-i` | `--identity` | Create the question corresponding to the specified number |
244244
| `-r` | `--random` | Create a random question that has not appeared in the current directory |
@@ -247,7 +247,7 @@ npm i --save-dev leetcode-practice
247247
#### [2]. lk
248248

249249
| Short Parameter | Full Parameter | Explanation |
250-
|------------------------|----------------|---------------------------------------------------------------------------------------------------------------------------------------------------|
250+
| ---------------------- | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
251251
| No parameter / `-t` | `--today` | Check today's daily question |
252252
| Question number / `-i` | `--identity` | Check the question corresponding to the specified number, and check if the question with the specified ID exists in the current working directory |
253253
| `-r` | `--random` | Check the question created using the random mode last time |
@@ -259,13 +259,13 @@ npm i --save-dev leetcode-practice
259259
#### [3]. lf
260260

261261
| Short Parameter | Full Parameter | Explanation |
262-
|-----------------|----------------|---------------------------------------------------------------------------|
262+
| --------------- | -------------- | ------------------------------------------------------------------------- |
263263
| No parameter | None | Enter interactive search, and search or filter questions based on prompts |
264264

265265
#### [4]. General Parameters
266266

267267
| Short Parameter | Full Parameter | Explanation |
268-
|------------------|---------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
268+
| ---------------- | ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
269269
| `-d <directory>` | `--directory <directory>` | Specify the working directory (a relative address of the current execution directory), which will affect the creation and checking |
270270
| `-V` | `--version` | Check the version number |
271271
| `-h` | `--help` | Get help information |

README_CN.md

+39-35
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@
2424

2525
### 0. 预备条件
2626

27-
| 工具 | 备注 |
28-
|----------|:----------------:|
29-
| nodejs | lts |
30-
| git | lts |
27+
| 工具 | 备注 |
28+
| -------- | :------------------------: |
29+
| nodejs | lts |
30+
| git | lts |
3131
| computer | 能够运行chrome和代码编辑器 |
3232
| patience | 一颗能够坚持刷题的心 |
3333

@@ -36,7 +36,9 @@
3636
> git:[git下载地址](https://git-scm.com/downloads)
3737
3838
### 1. 我可以怎么用? (三种方案供你选择)
39+
3940
#### 方案A.脚手架 CLI (推荐)
41+
4042
此方案是最为推荐的使用方案,通过脚手架指令`lc``lk``lf`自由灵活的在任意的目录中创建并检查你的题解。
4143

4244
> 使用预览
@@ -45,7 +47,7 @@
4547

4648
如果你想要快速的创建一个自己的题解库,可以使用我们的模板项目进行快速的创建github项目,并且获得完善的初始化内容。
4749

48-
> 使用预览
50+
> 使用预览
4951
5052
#### 方案C.插件 Plugin (支持,待开发)
5153

@@ -54,11 +56,12 @@
5456
> 使用预览
5557
5658
### 2. 我应该怎么用?(三种方案的详细的安装和使用教程)
59+
5760
#### 方案A.脚手架 CLI
5861

5962
##### 1.安装
6063

61-
你可以使用任意一款npm包管理软件(例如*`*npm*`*,*`*yarn*`*,*`*pnpm*`*等)的在`项目`中或者`全局`进行安装。
64+
你可以使用任意一款npm包管理软件(例如`npm`,`yarn`,`pnpm`等)的在`项目`中或者`全局`进行安装。
6265

6366
```shell
6467
# 示例:全局安装
@@ -179,7 +182,7 @@ MODE: identity
179182

180183
e.g. 以我个人的项目为例
181184

182-
```shell
185+
```shell
183186
# 这里只是示例,请拉取自己的项目(在你看到这进行尝试的时候,此项目可能已经被清理,正常现象请勿疑惑)
184187
git clone git@github.com:wh131462/my-leetcode-practice.git
185188
# 移动进项目目录
@@ -200,15 +203,16 @@ yarn lc
200203
```
201204

202205
你也可以使用指令`lc`来创建,当然,你只能在项目中使用我们的脚本(如果你没有全局安装`leetcode-practice`的话)。
206+
203207
```shell
204208
# 使用lc 会在当前工作目录创建 如果 需要和脚本的表现保持一致(指在src目录下创建),请使用 -d src 参数
205209
lc
206210
```
207211

208212
> 注意:在这里进行一下强调,项目内指令的说法是指指令的作用范围限制是当前的项目目录,也就是说在其他的目录,你尝试使用lc指令会发现不起作用。
209-
>
213+
>
210214
> 同样的,你也会发现在第一次安装好的时候,在项目内使用lc指令,也是不起作用的,这个时候需要关闭终端(terminal)再打开进行手动的刷新缓存。
211-
>
215+
>
212216
> npm脚本指在 package.json 中的 scripts 字段下封装的脚本指令。
213217
214218
###### 3. 更新依赖
@@ -230,48 +234,48 @@ npm i --save-dev leetcode-practice
230234

231235
`KFC`是一个简便记法,可以快速记忆我们的三个核心指令:`lk`,`lf`,`lc`
232236

233-
| 指令 | 说明 |
234-
|----|--------------------------------------------------------|
235-
| lc | 核心创建指令,支持三种创建模式 ( 每日一题、指定题目、随机题目 ) 进行题目的创建 |
236-
| lk | 核心检查指令,支持三种模式对应的题目检测 |
237-
| lf | 核心查找指令,可以快捷的搜索你想要的题目,支持Hot100,关键词搜索,条件筛选等模式进行搜索题目并支持创建 |
237+
| 指令 | 说明 |
238+
| ---- | ------------------------------------------------------------------------------------------------------ |
239+
| lc | 核心创建指令,支持三种创建模式 ( 每日一题、指定题目、随机题目 ) 进行题目的创建 |
240+
| lk | 核心检查指令,支持三种模式对应的题目检测 |
241+
| lf | 核心查找指令,可以快捷的搜索你想要的题目,支持Hot100,关键词搜索,条件筛选等模式进行搜索题目并支持创建 |
238242

239243
#### [1].lc
240244

241-
| 简单参数 | 完整参数 | 说明 |
242-
|-----------|--------------|------------------|
243-
| 无参数/`-t` | `--today` | 创建今日的每日一题 |
244-
| 题目编号/`-i` | `--identity` | 创建指定编号对应的题目 |
245-
| `-r` | `--random` | 创建当前目录下未出现过的随机题目 |
246-
| `-e` | `--easy` | 交互式创建题目 |
245+
| 简单参数 | 完整参数 | 说明 |
246+
| ------------- | ------------ | -------------------------------- |
247+
| 无参数/`-t` | `--today` | 创建今日的每日一题 |
248+
| 题目编号/`-i` | `--identity` | 创建指定编号对应的题目 |
249+
| `-r` | `--random` | 创建当前目录下未出现过的随机题目 |
250+
| `-e` | `--easy` | 交互式创建题目 |
247251

248252
#### [2].lk
249253

250-
| 简单参数 | 完整参数 | 说明 |
251-
|-----------|--------------|--------------------------------------|
252-
| 无参数/`-t` | `--today` | 检查今日的每日一题 |
254+
| 简单参数 | 完整参数 | 说明 |
255+
| ------------- | ------------ | ---------------------------------------------------------------------- |
256+
| 无参数/`-t` | `--today` | 检查今日的每日一题 |
253257
| 题目编号/`-i` | `--identity` | 检查指定编号对应的题目,会检查当前工作目录下的是否存在指定id对应的题目 |
254-
| `-r` | `--random` | 检查上一次使用随机模式创建的题目 |
255-
| `-e` | `--easy` | 交互式的根据提示去检查对应的题目 |
258+
| `-r` | `--random` | 检查上一次使用随机模式创建的题目 |
259+
| `-e` | `--easy` | 交互式的根据提示去检查对应的题目 |
256260

257261
> 注意: 当你检测的时候需要注意,使用什么模式去检查,请确保你已经执行过对应模式的创建操作。
258262
> 指定编号模式除外,因为会优先检查指定的id是否在当前工作目录存在。
259263
260264
#### [3].lf
261265

262-
| 简单参数 | 完整参数 | 说明 |
263-
|------|------|---------------------------|
264-
| 无参数 || 进入交互式查询,可根据提示搜索或筛选题目并创建题目 |
266+
| 简单参数 | 完整参数 | 说明 |
267+
| -------- | -------- | -------------------------------------------------- |
268+
| 无参数 | | 进入交互式查询,可根据提示搜索或筛选题目并创建题目 |
265269

266270
#### [4].通用参数
267271

268-
| 简单参数 | 完整参数 | 说明 |
269-
|------------------|---------------------------|---------------------------------------------------------------------------|
270-
| `-d <directory>` | `--directory <directory>` | 指定工作目录(是一个当前执行目录的相对地址),会影响创建和检查 |
271-
| `-V` | `--version` | 检查版本号 |
272-
| `-h` | `--help` | 获取帮助信息 |
272+
| 简单参数 | 完整参数 | 说明 |
273+
| ---------------- | ------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
274+
| `-d <directory>` | `--directory <directory>` | 指定工作目录(是一个当前执行目录的相对地址),会影响创建和检查 |
275+
| `-V` | `--version` | 检查版本号 |
276+
| `-h` | `--help` | 获取帮助信息 |
273277
| `-l [language]` | `--language [language]` | 不指定参数为获取当前的语言环境(默认为javascript),指定参数可以设置语言环境为对应语言(如`-l java`可以指定语言环境为java) |
274-
| `-u` | `--update` | 更新当前脚本或者依赖 |
278+
| `-u` | `--update` | 更新当前脚本或者依赖 |
275279

276280
> 注意:通用参数指三个脚本`lk`,`lf`,`lc`都支持的参数,使用上的语义一般来说是相同的,但是可能有些指令上的行为含义会有所不同(比如`lc`指令指定`-d`参数是指`在指定目录中创建题目`,而`lk`指令指定`-d`参数就是指`在指定目录创建题目`)。
277281
@@ -293,4 +297,4 @@ npm i --save-dev leetcode-practice
293297

294298
### 3.Star趋势图
295299

296-
[![Star History Chart](https://api.star-history.com/svg?repos=EternalHeartTeam/leetcode-practice&type=Date)](https://star-history.com/#EternalHeartTeam/leetcode-practice&Date)
300+
[![Star History Chart](https://api.star-history.com/svg?repos=EternalHeartTeam/leetcode-practice&type=Date)](https://star-history.com/#EternalHeartTeam/leetcode-practice&Date)

0 commit comments

Comments
 (0)