Skip to content

Commit 2d5def5

Browse files
committed
Add markdownlint
Add `markdownlint` linter and fix issues. Config is based on the one from electron's repo with a few rules relaxed.
1 parent 6554d51 commit 2d5def5

File tree

64 files changed

+1200
-746
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+1200
-746
lines changed

.editorconfig

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,3 @@ indent_style = tab
2626

2727
[*.svg]
2828
insert_final_newline = false
29-
30-
[*.md]
31-
trim_trailing_whitespace = false

.markdownlint.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
commands-show-output: false
2+
fenced-code-language: false
3+
first-line-h1: false
4+
header-increment: false
5+
line-length: {code_blocks: false, tables: false, stern: true, line_length: -1}
6+
no-alt-text: false
7+
no-bare-urls: false
8+
no-blanks-blockquote: false
9+
no-duplicate-header: {allow_different_nesting: true}
10+
no-emphasis-as-header: false
11+
no-empty-links: false
12+
no-hard-tabs: {code_blocks: false}
13+
no-inline-html: false
14+
no-space-in-code: false
15+
no-space-in-emphasis: false
16+
no-trailing-punctuation: false
17+
no-trailing-spaces: {br_spaces: 0}
18+
single-h1: false

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,7 @@ lint-frontend: node_modules
313313
npx eslint --color --max-warnings=0 --ext js,vue web_src/js build *.config.js docs/assets/js
314314
npx stylelint --color --max-warnings=0 web_src/less
315315
npx spectral lint -q -F hint $(SWAGGER_SPEC)
316+
npx markdownlint docs
316317

317318
.PHONY: lint-backend
318319
lint-backend: golangci-lint vet editorconfig-checker

docs/content/doc/advanced/clone-filter.en-us.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ see Git version of the server.
3030
By default, clone filters are enabled, unless `DISABLE_PARTIAL_CLONE` under
3131
`[git]` is set to `true`.
3232

33-
3433
See [GitHub blog post: Get up to speed with partial clone](https://github.blog/2020-12-21-get-up-to-speed-with-partial-clone-and-shallow-clone/)
3534
for common use cases of clone filters (blobless and treeless clones), and
3635
[GitLab docs for partial clone](https://docs.gitlab.com/ee/topics/git/partial_clone.html)

docs/content/doc/advanced/config-cheat-sheet.en-us.md

Lines changed: 61 additions & 47 deletions
Large diffs are not rendered by default.

docs/content/doc/advanced/config-cheat-sheet.zh-cn.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,8 @@ menu:
173173
- `ADAPTER`: **memory**: 缓存引擎,可以为 `memory`, `redis``memcache`
174174
- `INTERVAL`: **60**: 只对内存缓存有效,GC间隔,单位秒。
175175
- `HOST`: **\<empty\>**: 针对redis和memcache有效,主机地址和端口。
176-
- Redis: `network=tcp,addr=127.0.0.1:6379,password=macaron,db=0,pool_size=100,idle_timeout=180`
177-
- Memache: `127.0.0.1:9090;127.0.0.1:9091`
176+
- Redis: `network=tcp,addr=127.0.0.1:6379,password=macaron,db=0,pool_size=100,idle_timeout=180`
177+
- Memache: `127.0.0.1:9090;127.0.0.1:9091`
178178
- `ITEM_TTL`: **16h**: 缓存项目失效时间,设置为 -1 则禁用缓存。
179179

180180
## Cache - LastCommitCache settings (`cache.last_commit`)
@@ -239,7 +239,6 @@ file -I test01.xls
239239
test01.xls: application/vnd.ms-excel; charset=binary
240240
```
241241

242-
243242
## Log (`log`)
244243

245244
- `ROOT_PATH`: 日志文件根目录。
@@ -251,10 +250,9 @@ test01.xls: application/vnd.ms-excel; charset=binary
251250
- `ENABLED`: 是否在后台运行定期任务。
252251
- `RUN_AT_START`: 是否启动时自动运行。
253252
- `SCHEDULE` 所接受的格式
254-
- 完整 crontab 控制, 例如 `* * * * * ?`
255-
- 描述符, 例如 `@midnight`, `@every 1h30m` ...
256-
- 更多细节参见 [cron api文档](https://pkg.go.dev/github.com/gogs/[email protected])
257-
253+
- 完整 crontab 控制, 例如 `* * * * * ?`
254+
- 描述符, 例如 `@midnight`, `@every 1h30m` ...
255+
- 更多细节参见 [cron api文档](https://pkg.go.dev/github.com/gogs/[email protected])
258256

259257
### Cron - Update Mirrors (`cron.update_mirrors`)
260258

@@ -440,6 +438,7 @@ Repository archive 的存储配置。 如果 `STORAGE_TYPE` 为空,则此配
440438
- `PROXY_HOSTS`: **\<empty\>**: 逗号分隔的多个需要代理的网址,支持 * 号匹配符号, ** 表示匹配所有网站
441439

442440
i.e.
441+
443442
```ini
444443
PROXY_ENABLED = true
445444
PROXY_URL = socks://127.0.0.1:1080

docs/content/doc/advanced/customizing-gitea.en-us.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -149,13 +149,13 @@ copy javascript files from https://gitea.com/davidsvantesson/plantuml-code-highl
149149

150150
You can then add blocks like the following to your markdown:
151151

152-
```plantuml
153-
Alice -> Bob: Authentication Request
154-
Bob --> Alice: Authentication Response
152+
```plantuml
153+
Alice -> Bob: Authentication Request
154+
Bob --> Alice: Authentication Response
155155
156-
Alice -> Bob: Another authentication Request
157-
Alice <-- Bob: Another authentication Response
158-
```
156+
Alice -> Bob: Another authentication Request
157+
Alice <-- Bob: Another authentication Response
158+
```
159159

160160
The script will detect tags with `class="language-plantuml"`, but you can change this by providing a second argument to `parsePlantumlCodeBlocks`.
161161

docs/content/doc/advanced/environment-variables.zh-cn.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,31 +25,31 @@ GITEA_CUSTOM=/home/gitea/custom ./gitea web
2525

2626
因为 Gitea 使用 Go 语言编写,因此它使用了一些相关的 Go 的配置参数:
2727

28-
* `GOOS`
29-
* `GOARCH`
30-
* [`GOPATH`](https://golang.org/cmd/go/#hdr-GOPATH_environment_variable)
28+
* `GOOS`
29+
* `GOARCH`
30+
* [`GOPATH`](https://golang.org/cmd/go/#hdr-GOPATH_environment_variable)
3131

3232
您可以在[官方文档](https://golang.org/cmd/go/#hdr-Environment_variables)中查阅这些配置参数的详细信息。
3333

3434
## Gitea 的文件目录
3535

36-
* `GITEA_WORK_DIR`:工作目录的绝对路径
37-
* `GITEA_CUSTOM`:默认情况下 Gitea 使用默认目录 `GITEA_WORK_DIR`/custom,您可以使用这个参数来配置 *custom* 目录
38-
* `GOGS_WORK_DIR`: 已废弃,请使用 `GITEA_WORK_DIR` 替代
39-
* `GOGS_CUSTOM`: 已废弃,请使用 `GITEA_CUSTOM` 替代
36+
* `GITEA_WORK_DIR`:工作目录的绝对路径
37+
* `GITEA_CUSTOM`:默认情况下 Gitea 使用默认目录 `GITEA_WORK_DIR`/custom,您可以使用这个参数来配置 *custom* 目录
38+
* `GOGS_WORK_DIR`: 已废弃,请使用 `GITEA_WORK_DIR` 替代
39+
* `GOGS_CUSTOM`: 已废弃,请使用 `GITEA_CUSTOM` 替代
4040

4141
## 操作系统配置
4242

43-
* `USER`:Gitea 运行时使用的系统用户,它将作为一些 repository 的访问地址的一部分
44-
* `USERNAME`: 如果没有配置 `USER`, Gitea 将使用 `USERNAME`
45-
* `HOME`: 用户的 home 目录,在 Windows 中会使用 `USERPROFILE` 环境变量
43+
* `USER`:Gitea 运行时使用的系统用户,它将作为一些 repository 的访问地址的一部分
44+
* `USERNAME`: 如果没有配置 `USER`, Gitea 将使用 `USERNAME`
45+
* `HOME`: 用户的 home 目录,在 Windows 中会使用 `USERPROFILE` 环境变量
4646

4747
### 仅限于 Windows 的配置
4848

49-
* `USERPROFILE`: 用户的主目录,如果未配置则会使用 `HOMEDRIVE` + `HOMEPATH`
50-
* `HOMEDRIVE`: 用于访问 home 目录的主驱动器路径(C盘)
51-
* `HOMEPATH`:在指定主驱动器下的 home 目录相对路径
49+
* `USERPROFILE`: 用户的主目录,如果未配置则会使用 `HOMEDRIVE` + `HOMEPATH`
50+
* `HOMEDRIVE`: 用于访问 home 目录的主驱动器路径(C盘)
51+
* `HOMEPATH`:在指定主驱动器下的 home 目录相对路径
5252

5353
## Miscellaneous
5454

55-
* `SKIP_MINWINSVC`:如果设置为 1,在 Windows 上不会以 service 的形式运行。
55+
* `SKIP_MINWINSVC`:如果设置为 1,在 Windows 上不会以 service 的形式运行。

docs/content/doc/advanced/external-renderers.en-us.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ ALLOW_ATTR = class
127127
### Example: Office DOCX
128128

129129
Display Office DOCX files with [`pandoc`](https://pandoc.org/):
130+
130131
```ini
131132
[markup.docx]
132133
ENABLED = true
@@ -138,13 +139,15 @@ ALLOW_DATA_URI_IMAGES = true
138139
```
139140

140141
The template file has the following content:
142+
141143
```
142144
$body$
143145
```
144146

145147
### Example: Jupyter Notebook
146148

147149
Display Jupyter Notebook files with [`nbconvert`](https://github.com/jupyter/nbconvert):
150+
148151
```ini
149152
[markup.jupyter]
150153
ENABLED = true
@@ -156,9 +159,11 @@ ALLOW_DATA_URI_IMAGES = true
156159
```
157160

158161
## Customizing CSS
159-
The external renderer is specified in the .ini in the format `[markup.XXXXX]` and the HTML supplied by your external renderer will be wrapped in a `<div>` with classes `markup` and `XXXXX`. The `markup` class provides out of the box styling (as does `markdown` if `XXXXX` is `markdown`). Otherwise you can use these classes to specifically target the contents of your rendered HTML.
162+
163+
The external renderer is specified in the .ini in the format `[markup.XXXXX]` and the HTML supplied by your external renderer will be wrapped in a `<div>` with classes `markup` and `XXXXX`. The `markup` class provides out of the box styling (as does `markdown` if `XXXXX` is `markdown`). Otherwise you can use these classes to specifically target the contents of your rendered HTML.
160164

161165
And so you could write some CSS:
166+
162167
```css
163168
.markup.XXXXX html {
164169
font-size: 100%;
@@ -184,6 +189,7 @@ And so you could write some CSS:
184189
```
185190

186191
Add your stylesheet to your custom directory e.g `custom/public/css/my-style-XXXXX.css` and import it using a custom header file `custom/templates/custom/header.tmpl`:
192+
187193
```html
188194
<link type="text/css" href="{{AppSubUrl}}/assets/css/my-style-XXXXX.css" />
189195
```

docs/content/doc/advanced/mail-templates-us.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ This template produces something along these lines:
251251
>
252252
> \_********************************\_********************************
253253
>
254-
> Mike, I think we should tone down the blues a little.
254+
> Mike, I think we should tone down the blues a little.
255255
> \_********************************\_********************************
256256
>
257257
> [View it on Gitea](#).

0 commit comments

Comments
 (0)