Skip to content

Commit ff088f4

Browse files
authored
Merge pull request #4025 from ralfhandl/3.2.0-markdown-updates
Markdown updates for 3.2.0
2 parents 67eb7f3 + 37d5ae4 commit ff088f4

File tree

5 files changed

+842
-876
lines changed

5 files changed

+842
-876
lines changed

.github/workflows/validate-markdown.yaml

+3-1
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,12 @@ jobs:
2323
fetch-depth: 0
2424
- name: use the javascript environment from main
2525
run: |
26-
git checkout remotes/origin/main -- package.json package-lock.json
26+
git checkout remotes/origin/main -- package.json package-lock.json .markdownlint.yaml
2727
- uses: actions/setup-node@v4 # setup Node.js
2828
with:
2929
node-version: '20.x'
3030
- name: Validate markdown
3131
run: npx --yes mdv versions/3.*.md
32+
- name: Lint markdown v3.2.*
33+
run: npx --yes markdownlint-cli --config .markdownlint.yaml versions/3.2.*.md
3234

.markdownlint.yaml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Unordered list symbol
2+
MD004:
3+
style: asterisk
4+
5+
# Unordered list indentation
6+
MD007:
7+
indent: 2
8+
9+
MD012: false # allow blank lines
10+
11+
MD013:
12+
line_length: 800
13+
tables: false
14+
15+
MD024: false # duplicate headings
16+
MD033: false # inline HTML

package.json

+5-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"devDependencies": {
2727
"@hyperjump/json-schema": "^0.17.0",
2828
"chai": "^4.3.1",
29+
"markdownlint-cli": "^0.41.0",
2930
"mdv": "^1.0.7",
3031
"mocha": "^8.3.0",
3132
"yaml": "^1.8.3"
@@ -36,5 +37,8 @@
3637
"Swagger",
3738
"schema",
3839
"API"
39-
]
40+
],
41+
"scripts": {
42+
"format-markdown": "bash ./scripts/format-markdown.sh ./versions/3.2.0.md"
43+
}
4044
}

scripts/format-markdown.sh

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
3+
SRCDIR="$(dirname "${BASH_SOURCE[0]}")" # check on Windows
4+
5+
for filename in $*; do
6+
# mostly to format code blocks with examples, unfortunately messes up bullet lists and tables
7+
npx prettier --write --single-quote $filename
8+
9+
# repair the tables: remove superfluos spaces and dashes that make diffing revisions harder
10+
# and sed -i is not portable, so we need to use a temporary file
11+
sed -E -e "s/ +\|/ |/g" -e "s/\| +/| /g" -e "s/-----+/----/g" $filename > $filename.tmp && mv $filename.tmp $filename
12+
13+
# repair the bullet lists and various other markdown formatting issues
14+
npx --yes markdownlint-cli --fix --config $SRCDIR/../.markdownlint.yaml $filename
15+
done

0 commit comments

Comments
 (0)