mdrefine 0.2.0-rc.2 → 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.
Files changed (130) hide show
  1. package/CHANGELOG.md +577 -0
  2. package/CODE_OF_CONDUCT.md +30 -0
  3. package/CONTRIBUTING.md +189 -16
  4. package/README.md +100 -154
  5. package/SECURITY.md +15 -13
  6. package/config.schema.json +91 -0
  7. package/dist/cli/diff.d.ts +10 -0
  8. package/dist/cli/diff.js +247 -0
  9. package/dist/cli/diff.js.map +1 -0
  10. package/dist/cli/main.js +270 -150
  11. package/dist/cli/main.js.map +1 -1
  12. package/dist/config/load.js +67 -6
  13. package/dist/config/load.js.map +1 -1
  14. package/dist/config/problems.d.ts +7 -0
  15. package/dist/config/problems.js +208 -0
  16. package/dist/config/problems.js.map +1 -0
  17. package/dist/config/resolve.d.ts +42 -109
  18. package/dist/config/resolve.js +193 -52
  19. package/dist/config/resolve.js.map +1 -1
  20. package/dist/core/directives.d.ts +7 -0
  21. package/dist/core/directives.js +25 -13
  22. package/dist/core/directives.js.map +1 -1
  23. package/dist/core/engine.d.ts +42 -4
  24. package/dist/core/engine.js +518 -79
  25. package/dist/core/engine.js.map +1 -1
  26. package/dist/core/frozen.d.ts +6 -0
  27. package/dist/core/frozen.js +15 -0
  28. package/dist/core/frozen.js.map +1 -0
  29. package/dist/core/scope.d.ts +30 -0
  30. package/dist/core/scope.js +122 -0
  31. package/dist/core/scope.js.map +1 -0
  32. package/dist/core/types.d.ts +202 -23
  33. package/dist/core/types.js.map +1 -1
  34. package/dist/index.d.ts +2 -2
  35. package/dist/index.js.map +1 -1
  36. package/dist/node.d.ts +3 -0
  37. package/dist/node.js +4 -0
  38. package/dist/node.js.map +1 -0
  39. package/dist/rules/blocks.d.ts +34 -0
  40. package/dist/rules/blocks.js +550 -0
  41. package/dist/rules/blocks.js.map +1 -0
  42. package/dist/rules/content.d.ts +2 -0
  43. package/dist/rules/content.js +85 -0
  44. package/dist/rules/content.js.map +1 -0
  45. package/dist/rules/dialects.js +10 -6
  46. package/dist/rules/dialects.js.map +1 -1
  47. package/dist/rules/links.js +302 -6
  48. package/dist/rules/links.js.map +1 -1
  49. package/dist/rules/lists.d.ts +2 -0
  50. package/dist/rules/lists.js +924 -0
  51. package/dist/rules/lists.js.map +1 -0
  52. package/dist/rules/structure.js +127 -1
  53. package/dist/rules/structure.js.map +1 -1
  54. package/dist/rules/style.d.ts +8 -2
  55. package/dist/rules/style.js +1137 -165
  56. package/dist/rules/style.js.map +1 -1
  57. package/dist/syntax/block-identifier.d.ts +18 -0
  58. package/dist/syntax/block-identifier.js +24 -0
  59. package/dist/syntax/block-identifier.js.map +1 -0
  60. package/dist/syntax/obsidian.d.ts +29 -11
  61. package/dist/syntax/obsidian.js +9 -10
  62. package/dist/syntax/obsidian.js.map +1 -1
  63. package/dist/syntax/parse.d.ts +87 -3
  64. package/dist/syntax/parse.js +247 -19
  65. package/dist/syntax/parse.js.map +1 -1
  66. package/dist/workspace/access.d.ts +12 -3
  67. package/dist/workspace/access.js +33 -5
  68. package/dist/workspace/access.js.map +1 -1
  69. package/dist/workspace/discovery.d.ts +85 -0
  70. package/dist/workspace/discovery.js +155 -0
  71. package/dist/workspace/discovery.js.map +1 -0
  72. package/dist/workspace/encoding.d.ts +24 -0
  73. package/dist/workspace/encoding.js +113 -0
  74. package/dist/workspace/encoding.js.map +1 -0
  75. package/dist/workspace/files.d.ts +92 -6
  76. package/dist/workspace/files.js +715 -59
  77. package/dist/workspace/files.js.map +1 -1
  78. package/dist/workspace/git.d.ts +54 -0
  79. package/dist/workspace/git.js +198 -0
  80. package/dist/workspace/git.js.map +1 -0
  81. package/dist/workspace/index.d.ts +58 -3
  82. package/dist/workspace/index.js +136 -37
  83. package/dist/workspace/index.js.map +1 -1
  84. package/dist/workspace/selection.d.ts +2 -2
  85. package/dist/workspace/selection.js +3 -3
  86. package/dist/workspace/selection.js.map +1 -1
  87. package/dist/workspace/slug.js +8 -1
  88. package/dist/workspace/slug.js.map +1 -1
  89. package/dist/workspace/vault.js +3 -1
  90. package/dist/workspace/vault.js.map +1 -1
  91. package/docs/api.md +239 -0
  92. package/docs/benchmarks.md +140 -200
  93. package/docs/changelog.md +1 -0
  94. package/docs/cli.md +281 -89
  95. package/docs/configuration.md +193 -480
  96. package/docs/design.md +163 -284
  97. package/docs/dialects.md +169 -0
  98. package/docs/examples.md +151 -109
  99. package/docs/index.md +21 -37
  100. package/docs/integrations.md +144 -0
  101. package/docs/obsidian.md +91 -115
  102. package/docs/plugins.md +147 -212
  103. package/docs/quick-start.md +68 -74
  104. package/docs/rules.md +1237 -0
  105. package/docs/versions.md +56 -0
  106. package/examples/README.md +17 -14
  107. package/examples/automation/summarize-report.mjs +5 -2
  108. package/examples/library/lint-folder.mjs +5 -4
  109. package/examples/library/lint-workspace.mjs +32 -0
  110. package/examples/plugin/notes/release-checklist.md +2 -2
  111. package/examples/plugin/rules.mjs +17 -23
  112. package/examples/workspaces/obsidian-vault/after/mdtools.config.jsonc +2 -2
  113. package/examples/workspaces/obsidian-vault/before/mdtools.config.jsonc +2 -2
  114. package/examples/workspaces/repository-docs/after/README.md +2 -2
  115. package/examples/workspaces/repository-docs/after/mdtools.config.jsonc +0 -2
  116. package/examples/workspaces/repository-docs/before/README.md +2 -2
  117. package/examples/workspaces/repository-docs/before/docs/guide.md +7 -7
  118. package/examples/workspaces/repository-docs/before/docs/reference.md +3 -1
  119. package/examples/workspaces/repository-docs/before/mdtools.config.jsonc +0 -2
  120. package/package.json +38 -12
  121. package/docs/contributing.md +0 -218
  122. package/docs/releases/0.1.0-beta.1.md +0 -39
  123. package/docs/releases/0.1.0-beta.2.md +0 -83
  124. package/docs/releases/0.1.0-beta.3.md +0 -61
  125. package/docs/releases/0.1.0-beta.4.md +0 -50
  126. package/docs/releases/0.1.0-rc.1.md +0 -99
  127. package/docs/releases/0.2.0-rc.1.md +0 -141
  128. package/docs/releases/0.2.0-rc.2.md +0 -225
  129. package/docs/releases.md +0 -144
  130. package/docs/testing.md +0 -93
@@ -0,0 +1,56 @@
1
+ # Versions
2
+
3
+ Version numbers follow [Semantic Versioning](https://semver.org/). Before 1.0,
4
+ the second number plays the part of the first: a minor release such as 0.3.0 may
5
+ change what 0.2 does, and the [changelog](changelog.md) says how, while a patch
6
+ release such as 0.2.1 only fixes defects.
7
+
8
+ ## What a version number covers
9
+
10
+ - the `mdtools` commands, their options, and their exit codes;
11
+ - the [JSON report](cli.md#json-report) printed with `--json`: its fields and
12
+ what they mean;
13
+ - the configuration: file names, keys, presets, dialect names, rule IDs, rule
14
+ options, what each of them means, and where its [JSON
15
+ Schema](configuration.md#json-schema) is found;
16
+ - the library's exports from `mdrefine` and `mdrefine/node`, their TypeScript
17
+ types, and the plugin contract described in [library API](api.md) and
18
+ [plugins](plugins.md);
19
+ - the supported Node.js versions, given by `engines` in `package.json`.
20
+
21
+ These can change in any release:
22
+
23
+ - the wording of messages: diagnostics, warnings, and the summary line. A script
24
+ should read the exit code and the JSON report, whose diagnostics carry rule
25
+ IDs.
26
+ - formatting output that changes because a defect is fixed. A patch release can
27
+ format a document differently where the previous version damaged it, refused
28
+ it, or read it the wrong way, and can report findings that the defect hid.
29
+ - speed and memory use, and the figures on the [benchmark page](benchmarks.md).
30
+ - files of the package that the documentation does not describe.
31
+
32
+ A deliberate change of what formatting produces, such as a new default, a rule
33
+ added to a preset, or a changed option, comes in a minor release, and so does a
34
+ higher minimum Node.js version. Pin the exact version, as the
35
+ [installation](quick-start.md#install) does, so that you choose when such a
36
+ change reaches your documents.
37
+
38
+ ## Releases and channels
39
+
40
+ From 0.2.0, the first stable release, npm's `latest` tag names the newest stable
41
+ release. Release candidates and betas are published under the tags `rc` and
42
+ `beta` and leave `latest` alone. Only the newest release line receives fixes;
43
+ see the [security
44
+ policy](https://github.com/viell-dev/slop-markdown-tools/blob/main/SECURITY.md).
45
+ This site describes the newest stable release.
46
+
47
+ A version named in the repository is not necessarily published. The registry is
48
+ the source of truth:
49
+
50
+ ```sh
51
+ npm view mdrefine versions
52
+ ```
53
+
54
+ Each release has a [GitHub
55
+ release](https://github.com/viell-dev/slop-markdown-tools/releases) with the
56
+ tested package and its checksum.
@@ -1,25 +1,25 @@
1
1
  # Examples
2
2
 
3
- Working examples of configuring, running, and extending Markdown Tools. The
4
- [examples page](https://viell-dev.github.io/slop-markdown-tools/examples.html)
5
- walks through each one with its input and output. The integration tests run
6
- every example, so what is here matches what the tool does.
3
+ Working examples of configuring, running, and extending mdrefine. The [examples
4
+ page](https://viell-dev.github.io/slop-markdown-tools/examples.html) walks
5
+ through each one with its input and output. The integration tests run every
6
+ example, so what is here matches what the tool does.
7
7
 
8
8
  Run the commands below from a built checkout (`npm ci && npm run build`). In a
9
9
  project that installs the package, the same files are under
10
- `node_modules/mdrefine/examples/`, and `npx --no-install mdtools` replaces
10
+ `node_modules/mdrefine/examples/`, and `npx mdtools` replaces
11
11
  `node dist/cli/main.js`.
12
12
 
13
13
  ## Starting configurations
14
14
 
15
15
  Copy one to the root of your documents as `mdtools.config.jsonc`.
16
16
 
17
- | File | For |
18
- | ---------------------------------- | ------------------------------------------- |
19
- | [`github.jsonc`](github.jsonc) | Repositories rendered by GitHub |
20
- | [`forgejo.jsonc`](forgejo.jsonc) | Codeberg and other Forgejo instances |
21
- | [`gitea.jsonc`](gitea.jsonc) | Gitea instances |
22
- | [`obsidian.jsonc`](obsidian.jsonc) | Obsidian vaults, with vault-root link paths |
17
+ | File | For |
18
+ | ---------------------------------- | ----------------------------------------------- |
19
+ | [`github.jsonc`](github.jsonc) | Repositories rendered by GitHub |
20
+ | [`forgejo.jsonc`](forgejo.jsonc) | Codeberg and other Forgejo instances |
21
+ | [`gitea.jsonc`](gitea.jsonc) | Gitea instances |
22
+ | [`obsidian.jsonc`](obsidian.jsonc) | Obsidian vaults, with vault-relative link paths |
23
23
 
24
24
  ## Workspaces before and after formatting
25
25
 
@@ -32,7 +32,7 @@ reports it afterwards.
32
32
  two guides for a repository on GitHub.
33
33
  - [`workspaces/obsidian-vault/`](workspaces/obsidian-vault/) is a small vault
34
34
  with wikilinks, an embed, callouts, a block reference, and an ignored template
35
- folder.
35
+ directory.
36
36
 
37
37
  ```sh
38
38
  node dist/cli/main.js lint --root examples/workspaces/repository-docs/before
@@ -60,12 +60,15 @@ name, which works inside this repository and wherever the package is installed.
60
60
  ```sh
61
61
  node examples/library/format-string.mjs
62
62
  node examples/library/lint-folder.mjs
63
+ node examples/library/lint-workspace.mjs
63
64
  ```
64
65
 
65
66
  [`format-string.mjs`](library/format-string.mjs) formats one string.
66
67
  [`lint-folder.mjs`](library/lint-folder.mjs) reads a folder of GitHub Markdown,
67
- builds the workspace that link checks need, and prints diagnostics. Without an
68
- argument it reads `workspaces/repository-docs/after`.
68
+ builds the workspace that link checks need, and prints diagnostics.
69
+ [`lint-workspace.mjs`](library/lint-workspace.mjs) does the same with
70
+ `mdrefine/node`, which chooses the files as the CLI does. Without an argument,
71
+ both read `workspaces/repository-docs/after`.
69
72
 
70
73
  ## Automation
71
74
 
@@ -4,7 +4,8 @@
4
4
  //
5
5
  // The report is one object: { version, mode, files, written }, with a `skipped`
6
6
  // list when the run left out a path it was not permitted to read. Each file has
7
- // a `path`, its `diagnostics`, and for `format` a `changed` flag.
7
+ // a `path`, its `diagnostics`, and for `format` a `changed` flag; `written` lists
8
+ // the paths of the files that `format --write` wrote.
8
9
  let input = "";
9
10
  process.stdin.setEncoding("utf8");
10
11
  for await (const chunk of process.stdin) input += chunk;
@@ -27,7 +28,9 @@ console.log(`${report.mode}: ${report.files.length} file(s), ${diagnostics} diag
27
28
  if (report.mode === "format") {
28
29
  // `changed` stays true for a file that `--write` has just formatted.
29
30
  const changed = report.files.filter((file) => file.changed).length;
30
- console.log(`${changed} file(s) ${report.written ? "were formatted" : "need formatting"}`);
31
+ const written = report.written.length;
32
+ if (written) console.log(`${written} file(s) were formatted`);
33
+ if (!written || changed > written) console.log(`${changed - written} file(s) need formatting`);
31
34
  }
32
35
  for (const [key, entry] of [...counts].sort((a, b) => b[1].count - a[1].count)) {
33
36
  console.log(`${entry.count} ${key} in ${entry.files.size} file(s)`);
@@ -3,7 +3,8 @@
3
3
  // The library never reads or writes files. The host reads them and hands them
4
4
  // to createWorkspace(), which is what lets rules check links between documents.
5
5
  // This script reads everything below the folder; a real host would skip folders
6
- // such as .git and node_modules, as the CLI does.
6
+ // such as .git and node_modules, as the CLI does. lint-workspace.mjs leaves that
7
+ // to discoverWorkspace() from "mdrefine/node".
7
8
  //
8
9
  // node examples/library/lint-folder.mjs [folder]
9
10
  import { readdir, readFile } from "node:fs/promises";
@@ -17,14 +18,14 @@ const folder = path.resolve(
17
18
  const config = { extends: ["recommended", "github"] };
18
19
 
19
20
  // Workspace keys are forward-slash paths relative to the folder. A Markdown
20
- // file maps to its text; any other file maps to null, so that links to it
21
- // still resolve.
21
+ // file, named .md or .markdown as the CLI finds them, maps to its text; any
22
+ // other file maps to null, so that links to it still resolve.
22
23
  const files = {};
23
24
  for (const entry of await readdir(folder, { recursive: true, withFileTypes: true })) {
24
25
  if (!entry.isFile()) continue;
25
26
  const absolute = path.join(entry.parentPath, entry.name);
26
27
  const name = path.relative(folder, absolute).split(path.sep).join("/");
27
- files[name] = /\.md$/i.test(name) ? await readFile(absolute, "utf8") : null;
28
+ files[name] = /\.(?:md|markdown)$/i.test(name) ? await readFile(absolute, "utf8") : null;
28
29
  }
29
30
  const workspace = createWorkspace(files, { dialect: "github" });
30
31
 
@@ -0,0 +1,32 @@
1
+ // Lint a workspace on disk through the library, choosing files as the CLI does.
2
+ //
3
+ // discoverWorkspace() from "mdrefine/node" finds the files, honors .gitignore
4
+ // files and the configuration's ignore patterns, leaves out nested
5
+ // repositories and what it may not read, and recognizes Obsidian vaults.
6
+ // options() then gives each document what the CLI passes to lint() and
7
+ // format(). Configuration files are not read: pass the configuration.
8
+ //
9
+ // node examples/library/lint-workspace.mjs [folder]
10
+ import path from "node:path";
11
+ import { fileURLToPath } from "node:url";
12
+ import { lint } from "mdrefine";
13
+ import { discoverWorkspace } from "mdrefine/node";
14
+
15
+ const root = path.resolve(
16
+ process.argv[2] ?? fileURLToPath(new URL("../workspaces/repository-docs/after", import.meta.url)),
17
+ );
18
+ const config = { extends: ["recommended", "github"] };
19
+
20
+ const discovery = await discoverWorkspace({ root, config });
21
+ for (const item of discovery.skipped) console.log(`skipped: ${item.message}`);
22
+ let errors = 0;
23
+ for (const name of discovery.selected) {
24
+ for (const item of lint(discovery.read(name), discovery.options(name))) {
25
+ if (item.severity === "error") errors += 1;
26
+ console.log(
27
+ `${name}:${item.line}:${item.column} ${item.severity} ${item.rule}: ${item.message}`,
28
+ );
29
+ }
30
+ }
31
+ console.log(`${errors} error(s) in ${discovery.selected.length} document(s)`);
32
+ process.exitCode = errors > 0 ? 1 : 0;
@@ -4,6 +4,6 @@ Draft the announcement. TODO: add the download link.
4
4
 
5
5
  Searching the notes with `grep TODO` is not reported: code is not prose.
6
6
 
7
- ***
7
+ ## Before publishing
8
8
 
9
- Ask for a review before publishing.
9
+ Ask for a review.
@@ -15,7 +15,7 @@ export default {
15
15
  name: "house",
16
16
  presets: {
17
17
  recommended: {
18
- rules: { "house/no-placeholder": "error", "house/thematic-break": "warn" },
18
+ rules: { "house/no-placeholder": "error", "house/heading-space": "warn" },
19
19
  },
20
20
  },
21
21
  rules: {
@@ -57,36 +57,30 @@ export default {
57
57
  return findings;
58
58
  },
59
59
  },
60
- "thematic-break": {
61
- description: "Write thematic breaks as three hyphens.",
60
+ "heading-space": {
61
+ description: "Write one space between a heading's # marks and its text.",
62
62
  kind: "style",
63
63
  phase: "block",
64
64
  check({ document }) {
65
65
  const findings = [];
66
- const blocks = document.tree.children;
67
- // In a document whose first line is the thematic break "---", a later
68
- // "---" would close it as front matter, so no break is rewritten there.
69
- const opensFrontMatter =
70
- blocks[0]?.type === "thematicBreak" && document.source.startsWith("---");
71
- for (const [index, node] of blocks.entries()) {
72
- if (node.type !== "thematicBreak") continue;
66
+ visit(document.tree, (node) => {
67
+ if (node.type !== "heading" || !node.children.length) return;
73
68
  const start = node.position.start.offset;
74
- const end = node.position.end.offset;
75
- if (document.source.slice(start, end) === "---") continue;
76
- // "---" directly below a paragraph would turn that paragraph into a
77
- // heading. Only propose the edit after a blank line, where it cannot.
78
- const previous = blocks[index - 1];
79
- const safe =
80
- !opensFrontMatter &&
81
- previous &&
82
- previous.position.end.line < node.position.start.line - 1;
69
+ const text = node.children[0].position.start.offset;
70
+ const marks = document.source.slice(start, text);
71
+ const wanted = `${"#".repeat(node.depth)} `;
72
+ // Only a "#" heading starts with its marks: an underlined heading
73
+ // starts with its text, and so the check below leaves it alone. The
74
+ // parser drops the blank space before a heading's text, so changing
75
+ // it cannot change what the heading says.
76
+ if (!/^#+[ \t]+$/.test(marks) || marks === wanted) return;
83
77
  findings.push({
84
78
  start,
85
- end,
86
- message: "Write this thematic break as ---.",
87
- ...(safe ? { edit: { start, end, text: "---" } } : {}),
79
+ end: text,
80
+ message: "Write one space after the heading's # marks.",
81
+ edit: { start, end: text, text: wanted },
88
82
  });
89
- }
83
+ });
90
84
  return findings;
91
85
  },
92
86
  },
@@ -1,10 +1,10 @@
1
1
  {
2
- // An Obsidian vault; this file sits at the vault root, next to .obsidian/.
2
+ // An Obsidian vault; this file sits at the vault's root, next to .obsidian/.
3
3
  "extends": ["recommended", "obsidian"],
4
4
  // Templates contain placeholders, not prose. They stay valid link targets.
5
5
  "ignore": ["Templates/**"],
6
6
  "rules": {
7
- // Spell Markdown links as vault-root paths in angle brackets.
7
+ // Spell Markdown links as vault-relative paths in angle brackets.
8
8
  "links/path": ["warn", { "style": "root", "brackets": "angle" }],
9
9
  },
10
10
  }
@@ -1,10 +1,10 @@
1
1
  {
2
- // An Obsidian vault; this file sits at the vault root, next to .obsidian/.
2
+ // An Obsidian vault; this file sits at the vault's root, next to .obsidian/.
3
3
  "extends": ["recommended", "obsidian"],
4
4
  // Templates contain placeholders, not prose. They stay valid link targets.
5
5
  "ignore": ["Templates/**"],
6
6
  "rules": {
7
- // Spell Markdown links as vault-root paths in angle brackets.
7
+ // Spell Markdown links as vault-relative paths in angle brackets.
8
8
  "links/path": ["warn", { "style": "root", "brackets": "angle" }],
9
9
  },
10
10
  }
@@ -8,8 +8,8 @@ a sensor board and publishes them as a small web page that updates every minute.
8
8
 
9
9
  ## Usage
10
10
 
11
- Follow the [setup guide](./docs/guide.md) first, then read the
12
- [sensor reference](./docs/reference.md#pressure) to interpret the readings. The
11
+ Follow the [setup guide](./docs/guide.md) first, then read the [sensor
12
+ reference](./docs/reference.md#pressure) to interpret the readings. The
13
13
  [calibration notes](docs/calibration.md) explain how to correct a drifting
14
14
  sensor.
15
15
 
@@ -2,8 +2,6 @@
2
2
  // Documentation for a repository hosted on GitHub.
3
3
  "extends": ["recommended", "github"],
4
4
  "rules": {
5
- // Not part of a preset: turn underlined headings into "#" headings.
6
- "style/heading": "warn",
7
5
  // Write local links as ./relative paths, which editors can follow too.
8
6
  "links/path": ["warn", { "style": "relative", "leadingDot": true }],
9
7
  },
@@ -17,5 +17,5 @@ Follow the [setup guide](docs/guide.md) first, then read the [sensor reference](
17
17
  | Humidity | % | Yes |
18
18
  | Pressure | hPa | Since 1.2 |
19
19
 
20
- - [X] Publish readings every minute
21
- - [ ] Keep a week of history
20
+ * [X] Publish readings every minute
21
+ * [ ] Keep a week of history
@@ -3,14 +3,14 @@ Setup guide
3
3
 
4
4
  This guide takes a new board from the box to its first published reading. Allow about ten minutes, most of which is waiting for the sensors to settle.
5
5
 
6
- 1. Connect the board over USB and wait until the status light stops blinking. A steady light means the sensors have settled and the readings can be trusted.
7
- 2. Copy `station.toml` to the board and set the publishing interval:
6
+ 1) Connect the board over USB and wait until the status light stops blinking. A steady light means the sensors have settled and the readings can be trusted.
7
+ 2) Copy `station.toml` to the board and set the publishing interval:
8
8
 
9
- ```toml
10
- [publish]
11
- interval_seconds = 60 # Lines in code blocks are never wrapped, however long they are.
12
- ```
9
+ ~~~toml
10
+ [publish]
11
+ interval_seconds = 60 # Lines in code blocks are never wrapped, however long they are.
12
+ ~~~
13
13
 
14
- 3. Open the page listed under [Usage](../README.md#usage) and check that all three readings appear.
14
+ 3) Open the page listed under [Usage](../README.md#usage) and check that all three readings appear.
15
15
 
16
16
  Readings that look wrong are usually a unit problem; the [reference](reference.md) lists the unit of every sensor.
@@ -4,10 +4,12 @@
4
4
 
5
5
  Reported in degrees Celsius, rounded to one decimal place.
6
6
 
7
- ## Humidity
7
+ ## Humidity ##
8
8
 
9
9
  Reported as relative humidity in percent.
10
10
 
11
+
12
+
11
13
  ## Pressure
12
14
 
13
15
  Reported in hectopascals. Pressure needs about two minutes after power-on before the first stable value; see the __[setup guide](guide.md)__.
@@ -2,8 +2,6 @@
2
2
  // Documentation for a repository hosted on GitHub.
3
3
  "extends": ["recommended", "github"],
4
4
  "rules": {
5
- // Not part of a preset: turn underlined headings into "#" headings.
6
- "style/heading": "warn",
7
5
  // Write local links as ./relative paths, which editors can follow too.
8
6
  "links/path": ["warn", { "style": "relative", "leadingDot": true }],
9
7
  },
package/package.json CHANGED
@@ -1,7 +1,23 @@
1
1
  {
2
2
  "name": "mdrefine",
3
- "version": "0.2.0-rc.2",
3
+ "version": "0.2.0",
4
4
  "description": "Configurable Markdown linting and formatting for CommonMark, GitHub, Forgejo, Gitea, and Obsidian",
5
+ "keywords": [
6
+ "markdown",
7
+ "lint",
8
+ "linter",
9
+ "format",
10
+ "formatter",
11
+ "commonmark",
12
+ "gfm",
13
+ "github",
14
+ "forgejo",
15
+ "codeberg",
16
+ "gitea",
17
+ "obsidian",
18
+ "mdast",
19
+ "micromark"
20
+ ],
5
21
  "type": "module",
6
22
  "license": "MIT",
7
23
  "author": "viell",
@@ -21,20 +37,28 @@
21
37
  "publishConfig": {
22
38
  "access": "public",
23
39
  "registry": "https://registry.npmjs.org/",
24
- "tag": "rc"
40
+ "tag": "latest"
25
41
  },
26
42
  "exports": {
27
43
  ".": {
28
44
  "types": "./dist/index.d.ts",
29
- "import": "./dist/index.js"
30
- }
45
+ "default": "./dist/index.js"
46
+ },
47
+ "./node": {
48
+ "types": "./dist/node.d.ts",
49
+ "default": "./dist/node.js"
50
+ },
51
+ "./config.schema.json": "./config.schema.json",
52
+ "./package.json": "./package.json"
31
53
  },
32
54
  "files": [
33
55
  "dist",
56
+ "config.schema.json",
34
57
  "docs/*.md",
35
- "docs/releases/*.md",
36
58
  "examples",
37
59
  "README.md",
60
+ "CHANGELOG.md",
61
+ "CODE_OF_CONDUCT.md",
38
62
  "CONTRIBUTING.md",
39
63
  "SECURITY.md",
40
64
  "LICENSE",
@@ -68,9 +92,12 @@
68
92
  "benchmark": "node benchmarks/run.mjs",
69
93
  "prebenchmark": "npm run build",
70
94
  "release:prepare": "run-s check release:pack",
71
- "release:pack": "node scripts/package-smoke.mjs --retain"
95
+ "release:pack": "node scripts/package-smoke.mjs --retain",
96
+ "schema": "run-s build schema:write",
97
+ "schema:write": "node scripts/config-schema.mjs"
72
98
  },
73
99
  "dependencies": {
100
+ "@types/mdast": "4.0.4",
74
101
  "ajv": "8.20.0",
75
102
  "commander": "15.0.0",
76
103
  "decode-named-character-reference": "1.3.0",
@@ -93,17 +120,16 @@
93
120
  },
94
121
  "devDependencies": {
95
122
  "@eslint/js": "10.0.1",
96
- "@types/mdast": "4.0.4",
97
- "@types/node": "26.6.4",
123
+ "@types/node": "22.20.5",
98
124
  "@types/unist": "3.0.3",
99
- "eslint": "10.12.0",
125
+ "eslint": "10.13.0",
100
126
  "fast-check": "4.10.2",
101
127
  "npm-run-all2": "9.0.3",
102
- "prettier": "3.9.9",
128
+ "prettier": "3.9.10",
103
129
  "typescript": "6.0.3",
104
- "typescript-eslint": "8.71.1",
130
+ "typescript-eslint": "8.71.2",
105
131
  "vitepress": "2.0.0-alpha.20",
106
- "vitest": "5.0.3"
132
+ "vitest": "5.0.5"
107
133
  },
108
134
  "homepage": "https://viell-dev.github.io/slop-markdown-tools/"
109
135
  }