Skip to content

Commit d84b6d2

Browse files
committed
update markdownlint and editorconfig configuration
add task targets add pre-commit config
1 parent 4f572ea commit d84b6d2

File tree

4 files changed

+64
-16
lines changed

4 files changed

+64
-16
lines changed

.editorconfig

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ trim_trailing_whitespace = true
1616
indent_style = space
1717
indent_size = 2
1818

19-
# 4 space indentation
20-
[*.md]
19+
# Matches multiple files with brace expansion notation
20+
# Set default charset
21+
[*.{md}]
2122
indent_style = space
2223
indent_size = 4
2324

.markdownlint.jsonc

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,45 @@
11
{
22
// Example markdownlint JSON(C) configuration with all properties set to their default value
3-
43
// Default state for all rules
54
"default": true,
6-
75
// not enforcing line break a specific lenght
86
"MD013": false,
9-
107
"MD007": {
118
"indent": 4
129
},
13-
1410
// allow Multiple headings with the same content
1511
"MD024": false,
16-
12+
// allow multiple top level headings -> generated files
13+
"MD025": false,
1714
// to be consistent with prettier
1815
"MD030": {
19-
"ul_single": 3,
20-
"ul_multi": 3
16+
"ul_single": 1,
17+
"ul_multi": 1
2118
},
22-
2319
// allow some html
2420
"MD033": {
25-
"allowed_elements": ["figure", "figcaption", "div"]
21+
"allowed_elements": [
22+
"figure",
23+
"figcaption",
24+
"div",
25+
"details",
26+
"summary",
27+
"a",
28+
"p",
29+
"img",
30+
"span",
31+
"br"
32+
]
2633
},
27-
34+
// not enfore h1 as first content of a file
35+
"MD041": false,
2836
// allow missing img alt text
2937
"MD045": false,
30-
3138
// disabled due to admonition / tabs using indented blocks
32-
"MD046": false
33-
//"MD046": { "style": "fenced" }
34-
}
39+
"MD046": false,
40+
//"MD046": { "style": "fenced" },
41+
// allow non-descriptive link text, like "here"
42+
"MD059": false,
43+
// relax table formatting rules
44+
"MD060": false
45+
}

.pre-commit-config.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
---
3+
repos:
4+
- repo: local
5+
hooks:
6+
7+
- id: markdownlint
8+
name: check:markdownlint
9+
entry: task check:markdownlint
10+
language: python
11+
pass_filenames: false

Taskfile.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,3 +180,28 @@ tasks:
180180
cmds:
181181
- poetry run mike serve -b {{.PUBLIC_BRANCH}}
182182

183+
format:fix:
184+
desc: markdownlit md files and apply possible style fixes
185+
cmds:
186+
- |
187+
{
188+
# recurse
189+
find ./docs -type f -name '*.md' -print0
190+
191+
# no recursion (top-level only)
192+
find . -maxdepth 1 -type f -name '*.md' -print0
193+
} | xargs -0 markdownlint --config .markdownlint.jsonc --fix
194+
195+
check:markdownlint:
196+
desc: run markdownlint on md files for style issues
197+
cmds:
198+
#- mkdir -p ./dist
199+
- |
200+
{
201+
# recurse
202+
find ./docs -type f -name '*.md' -print0
203+
204+
# no recursion (top-level only)
205+
find . -maxdepth 1 -type f -name '*.md' -print0
206+
} | xargs -0 markdownlint --config .markdownlint.jsonc
207+
# --json --output ./dist/markdownlint-issues.json

0 commit comments

Comments
 (0)