Skip to content

Commit 4df51f8

Browse files
committed
docs: add linter
1 parent 6bdc809 commit 4df51f8

File tree

6 files changed

+28
-27
lines changed

6 files changed

+28
-27
lines changed

.markdownlint.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"style": "---"
1515
},
1616
"MD040": false,
17+
"MD045": false,
1718
"MD046": false,
1819
"MD049": false
1920
}

docs/books/software-quality.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,5 +127,5 @@ Bob 大叔将自己对整洁代码的理解浓缩在了这本书中,真可谓
127127

128128
最后再推荐两个相关的文档:
129129

130-
- **阿里巴巴 Java 开发手册**https://github.com/alibaba/p3c
131-
- **Google Java 编程风格指南** http://www.hawstein.com/posts/google-java-style.html
130+
- **阿里巴巴 Java 开发手册**<https://github.com/alibaba/p3c>
131+
- **Google Java 编程风格指南**<http://www.hawstein.com/posts/google-java-style.html>

docs/distributed-system/distributed-id.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ COMMIT;
8484

8585
插入数据这里,我们没有使用 `insert into` 而是使用 `replace into` 来插入数据,具体步骤是这样的:
8686

87-
1)第一步: 尝试把数据插入到表中。
87+
- 第一步: 尝试把数据插入到表中。
8888

89-
2)第二步: 如果主键或唯一索引字段出现重复数据错误而插入失败时,先从表中删除含有重复关键字值的冲突行,然后再次尝试把数据插入到表中。
89+
- 第二步: 如果主键或唯一索引字段出现重复数据错误而插入失败时,先从表中删除含有重复关键字值的冲突行,然后再次尝试把数据插入到表中。
9090

9191
这种方式的优缺点也比较明显:
9292

@@ -127,7 +127,7 @@ CREATE TABLE `sequence_id_generator` (
127127
```sql
128128
INSERT INTO `sequence_id_generator` (`id`, `current_max_id`, `step`, `version`, `biz_type`)
129129
VALUES
130-
(1, 0, 100, 0, 101);
130+
(1, 0, 100, 0, 101);
131131
```
132132

133133
**3.通过 SELECT 获取指定业务下的批量唯一 ID**
@@ -139,8 +139,8 @@ SELECT `current_max_id`, `step`,`version` FROM `sequence_id_generator` where `bi
139139
结果:
140140

141141
```
142-
id current_max_id step version biz_type
143-
1 0 100 0 101
142+
id current_max_id step version biz_type
143+
1 0 100 0 101
144144
```
145145

146146
**4.不够用的话,更新之后重新 SELECT 即可。**
@@ -153,8 +153,8 @@ SELECT `current_max_id`, `step`,`version` FROM `sequence_id_generator` where `bi
153153
结果:
154154

155155
```
156-
id current_max_id step version biz_type
157-
1 100 100 1 101
156+
id current_max_id step version biz_type
157+
1 100 100 1 101
158158
```
159159

160160
相比于数据库主键自增的方式,**数据库的号段模式对于数据库的访问次数更少,数据库压力更小。**

docs/system-design/J2EE基础知识.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44

55
## 阐述 Servlet 和 CGI 的区别?
66

7-
### CGI 的不足之处:
7+
### CGI 的不足之处
88

99
1,需要为每个请求启动一个操作 CGI 程序的系统进程。如果请求频繁,这将会带来很大的开销。
1010

1111
2,需要为每个请求加载和运行一个 CGI 程序,这将带来很大的开销
1212

1313
3,需要重复编写处理网络协议的代码以及编码,这些工作都是非常耗时的。
1414

15-
### Servlet 的优点:
15+
### Servlet 的优点
1616

1717
1,只需要启动一个操作系统进程以及加载一个 JVM,大大降低了系统的开销
1818

@@ -48,8 +48,8 @@ get 和 post 请求实际上是没有区别,大家可以自行查询相关文
4848

4949
推荐阅读:
5050

51-
- https://www.zhihu.com/question/28586791
52-
- https://mp.weixin.qq.com/s?__biz=MzI3NzIzMzg3Mw==&mid=100000054&idx=1&sn=71f6c214f3833d9ca20b9f7dcd9d33e4#rd
51+
- <https://www.zhihu.com/question/28586791>
52+
- <https://mp.weixin.qq.com/s?__biz=MzI3NzIzMzg3Mw==&mid=100000054&idx=1&sn=71f6c214f3833d9ca20b9f7dcd9d33e4#rd>
5353

5454
## 什么情况下调用 doGet()和 doPost()
5555

@@ -70,23 +70,23 @@ Form 标签里的 method 的属性为 get 时调用 doGet(),为 post 时调用
7070

7171
1. **从地址栏显示来说**
7272

73-
forward 是服务器请求资源,服务器直接访问目标地址的 URL,把那个 URL 的响应内容读取过来,然后把这些内容再发给浏览器.浏览器根本不知道服务器发送的内容从哪里来的,所以它的地址栏还是原来的地址.
74-
redirect 是服务端根据逻辑,发送一个状态码,告诉浏览器重新去请求那个地址.所以地址栏显示的是新的 URL.
73+
forward 是服务器请求资源,服务器直接访问目标地址的 URL,把那个 URL 的响应内容读取过来,然后把这些内容再发给浏览器.浏览器根本不知道服务器发送的内容从哪里来的,所以它的地址栏还是原来的地址.
74+
redirect 是服务端根据逻辑,发送一个状态码,告诉浏览器重新去请求那个地址.所以地址栏显示的是新的 URL.
7575

7676
2. **从数据共享来说**
7777

78-
forward:转发页面和转发到的页面可以共享 request 里面的数据.
79-
redirect:不能共享数据.
78+
forward:转发页面和转发到的页面可以共享 request 里面的数据.
79+
redirect:不能共享数据.
8080

8181
3. **从运用地方来说**
8282

83-
forward:一般用于用户登陆的时候,根据角色转发到相应的模块.
84-
redirect:一般用于用户注销登陆时返回主页面和跳转到其它的网站等
83+
forward:一般用于用户登陆的时候,根据角色转发到相应的模块.
84+
redirect:一般用于用户注销登陆时返回主页面和跳转到其它的网站等
8585

8686
4. 从效率来说
8787

88-
forward:高.
89-
redirect:低.
88+
forward:高.
89+
redirect:低.
9090

9191
## 自动刷新(Refresh)
9292

@@ -125,7 +125,7 @@ JSP 是一种 Servlet,但是与 HttpServlet 的工作方式不太一样。Http
125125

126126
## JSP 有哪些内置对象、作用分别是什么
127127

128-
[JSP 内置对象 - CSDN 博客 ](http://blog.csdn.net/qq_34337272/article/details/64310849)
128+
[JSP 内置对象 - CSDN 博客](http://blog.csdn.net/qq_34337272/article/details/64310849)
129129

130130
JSP 有 9 个内置对象:
131131

docs/system-design/schedule-task.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,8 @@ public class TestJob implements SimpleJob {
231231
232232
**相关地址:**
233233
234-
- Github 地址:https://github.com/apache/shardingsphere-elasticjob。
235-
- 官方网站:https://shardingsphere.apache.org/elasticjob/index_zh.html 。
234+
- Github 地址:<https://github.com/apache/shardingsphere-elasticjob。>
235+
- 官方网站:<https://shardingsphere.apache.org/elasticjob/index_zh.html>
236236
237237
**优缺点总结:**
238238
@@ -288,8 +288,8 @@ public ReturnT<String> myAnnotationJobHandler(String param) throws Exception {
288288
289289
**相关地址:**
290290
291-
- Github 地址:https://github.com/xuxueli/xxl-job/。
292-
- 官方介绍:https://www.xuxueli.com/xxl-job/ 。
291+
- Github 地址:<https://github.com/xuxueli/xxl-job/。>
292+
- 官方介绍:<https://www.xuxueli.com/xxl-job/>
293293
294294
**优缺点总结:**
295295

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"docs:build": "vuepress build docs",
1111
"docs:dev": "vuepress dev docs",
1212
"docs:clean-dev": "vuepress dev docs --clean-cache",
13-
"lint": "prettier --check --write . && markdownlint **/*.md"
13+
"lint": "prettier --check --write . && markdownlint docs/**/*.md"
1414
},
1515
"dependencies": {
1616
"@vuepress/client": "2.0.0-beta.61",

0 commit comments

Comments
 (0)