mdrefine 0.2.0-rc.3 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +68 -0
- package/CONTRIBUTING.md +2 -1
- package/README.md +1 -1
- package/dist/cli/diff.d.ts +10 -0
- package/dist/cli/diff.js +247 -0
- package/dist/cli/diff.js.map +1 -0
- package/dist/cli/main.js +14 -7
- package/dist/cli/main.js.map +1 -1
- package/dist/rules/blocks.js +17 -5
- package/dist/rules/blocks.js.map +1 -1
- package/dist/rules/style.js +24 -5
- package/dist/rules/style.js.map +1 -1
- package/dist/syntax/parse.d.ts +14 -1
- package/dist/syntax/parse.js +22 -2
- package/dist/syntax/parse.js.map +1 -1
- package/dist/workspace/discovery.d.ts +8 -3
- package/dist/workspace/discovery.js +21 -9
- package/dist/workspace/discovery.js.map +1 -1
- package/dist/workspace/files.d.ts +17 -1
- package/dist/workspace/files.js +82 -6
- package/dist/workspace/files.js.map +1 -1
- package/docs/api.md +3 -1
- package/docs/benchmarks.md +41 -41
- package/docs/cli.md +17 -7
- package/docs/design.md +5 -0
- package/docs/integrations.md +8 -2
- package/docs/quick-start.md +1 -1
- package/docs/rules.md +11 -4
- package/package.json +2 -2
package/docs/design.md
CHANGED
|
@@ -63,6 +63,11 @@ The comparison is only as good as the parser's reading:
|
|
|
63
63
|
and `style/block-spacing` leave text whose second line is a table delimiter
|
|
64
64
|
row as written ([issue
|
|
65
65
|
#283](https://github.com/viell-dev/slop-markdown-tools/issues/283)).
|
|
66
|
+
- Front matter needs a closing line. A first line of `---` or `+++` that no
|
|
67
|
+
later line closes is read as renderers read it, as a thematic break or text,
|
|
68
|
+
with the lists and block quotes below it; the parser's front matter extension
|
|
69
|
+
reads them as paragraphs there, so the tool leaves it out for such a document
|
|
70
|
+
([issue #278](https://github.com/viell-dev/slop-markdown-tools/issues/278)).
|
|
66
71
|
- Front matter ends at the next `---` or `+++` line, also one inside a code
|
|
67
72
|
block, for the parser, for site generators, and for GitHub's file view when
|
|
68
73
|
the front matter is a YAML mapping. GitHub's comments, and renderers without
|
package/docs/integrations.md
CHANGED
|
@@ -31,7 +31,10 @@ it runs, and adds what the commands changed to the commit, configure it in
|
|
|
31
31
|
```json
|
|
32
32
|
{
|
|
33
33
|
"lint-staged": {
|
|
34
|
-
"*.{md,markdown}": [
|
|
34
|
+
"*.{md,markdown}": [
|
|
35
|
+
"mdtools format --write --no-warn-ignored",
|
|
36
|
+
"mdtools lint --max-warnings 0 --no-warn-ignored"
|
|
37
|
+
]
|
|
35
38
|
}
|
|
36
39
|
}
|
|
37
40
|
```
|
|
@@ -43,9 +46,12 @@ the commit adds or changes:
|
|
|
43
46
|
```sh
|
|
44
47
|
#!/bin/sh
|
|
45
48
|
git diff --cached --name-only -z --diff-filter=ACMR -- '*.md' '*.markdown' |
|
|
46
|
-
xargs -0 -r npx mdtools lint --max-warnings 0 --
|
|
49
|
+
xargs -0 -r npx mdtools lint --max-warnings 0 --no-warn-ignored --
|
|
47
50
|
```
|
|
48
51
|
|
|
52
|
+
In both, `--no-warn-ignored` leaves out the
|
|
53
|
+
[warning](cli.md#which-files-are-processed) for a changed file that the tool
|
|
54
|
+
skips, such as one that the configuration's `ignore` patterns match.
|
|
49
55
|
`--diff-filter=ACMR` leaves out deleted files, which would be an error as paths.
|
|
50
56
|
`xargs -r` skips the command when no file changed. `--` keeps a file name that
|
|
51
57
|
starts with `-` from being read as an option. This hook checks each file as it
|
package/docs/quick-start.md
CHANGED
|
@@ -6,7 +6,7 @@ mdrefine needs Node.js 22.12 or newer. Install the package in the project that
|
|
|
6
6
|
holds your documents:
|
|
7
7
|
|
|
8
8
|
```sh
|
|
9
|
-
npm install --save-dev --save-exact mdrefine@0.2.0
|
|
9
|
+
npm install --save-dev --save-exact mdrefine@0.2.0
|
|
10
10
|
npx --no-install mdtools --help
|
|
11
11
|
```
|
|
12
12
|
|
package/docs/rules.md
CHANGED
|
@@ -825,7 +825,9 @@ because directly below text its line would continue the paragraph. It keeps its
|
|
|
825
825
|
`#` when its text starts like another block, such as a list item, block quote,
|
|
826
826
|
thematic break, fence, HTML, or link reference definition, when it contains `|`,
|
|
827
827
|
which `---` below it could make a table, or when it ends with a backslash, and
|
|
828
|
-
on Forgejo and Gitea when it contains `{`.
|
|
828
|
+
on Forgejo and Gitea when it contains `{`. Below a first line of `---` that no
|
|
829
|
+
line closes, a level-2 underline has at least four `-`, because `---` would
|
|
830
|
+
close it as front matter.
|
|
829
831
|
|
|
830
832
|
## `style/inline-code`
|
|
831
833
|
|
|
@@ -1100,8 +1102,11 @@ means:
|
|
|
1100
1102
|
`---` would underline as a heading.
|
|
1101
1103
|
- On the line of a list item whose marker is the new marker's character, as in
|
|
1102
1104
|
`- ***` with `---`: `- ---` is one thematic break, not a list item.
|
|
1103
|
-
- At the start of a document,
|
|
1104
|
-
|
|
1105
|
+
- At the start of a document, with `---`, which would open front matter if a
|
|
1106
|
+
later line of `---` closed it, and a `---` that site generators read as the
|
|
1107
|
+
start of front matter.
|
|
1108
|
+
- With `---`, at the start of a line below a first line of `---` that no line
|
|
1109
|
+
closes, which `---` would close as front matter.
|
|
1105
1110
|
|
|
1106
1111
|
## `style/trailing-space`
|
|
1107
1112
|
|
|
@@ -1149,7 +1154,9 @@ span, an image, math, a link's destination, a template tag on one line such as
|
|
|
1149
1154
|
`{% data x %}` or `{{ title }}`, and a word longer than the line stay whole and
|
|
1150
1155
|
can overflow; a code span or an image description written across lines is joined
|
|
1151
1156
|
onto one, without the spaces and tabs that start its next line, as renderers
|
|
1152
|
-
read it.
|
|
1157
|
+
read it. In Obsidian, the text of a link stays whole and is joined onto one line
|
|
1158
|
+
too, because Live Preview shows a link whose text spans lines as its Markdown
|
|
1159
|
+
source. List markers, block quote markers, and indentation count toward the
|
|
1153
1160
|
width, a tab up to the next multiple of four columns.
|
|
1154
1161
|
|
|
1155
1162
|
A word that would start a block at the start of a line, such as a list marker,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mdrefine",
|
|
3
|
-
"version": "0.2.0
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Configurable Markdown linting and formatting for CommonMark, GitHub, Forgejo, Gitea, and Obsidian",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"markdown",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"publishConfig": {
|
|
38
38
|
"access": "public",
|
|
39
39
|
"registry": "https://registry.npmjs.org/",
|
|
40
|
-
"tag": "
|
|
40
|
+
"tag": "latest"
|
|
41
41
|
},
|
|
42
42
|
"exports": {
|
|
43
43
|
".": {
|