prettier-plugin-mmd 0.4.1 → 0.5.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/README.ja.md +5 -1
- package/README.md +7 -4
- package/lib/index.d.mts +1 -1
- package/lib/index.mjs +750 -178
- package/package.json +9 -2
package/README.ja.md
CHANGED
|
@@ -228,7 +228,11 @@ flowchart LR
|
|
|
228
228
|
- ディレクティブ、不透明な `@{ ... }` のデータブロック、
|
|
229
229
|
フロントマターの中身は検査しません。
|
|
230
230
|
その中身のために mermaid.js が拒否する図も整形します。
|
|
231
|
-
|
|
231
|
+
ディレクティブは書かれたまま残します。
|
|
232
|
+
不透明な `@{ ... }` データブロックも中身を残し、1 行のブロックは、
|
|
233
|
+
両端の内側に空白を 1 つずつ置いて印字します。
|
|
234
|
+
複数行のブロックだけ、条件を満たすときに全行を同じ数の空白で動かします。
|
|
235
|
+
条件は[データブロック](./docs/flowchart.ja.md#データブロック)にあります。
|
|
232
236
|
フロントマターは Prettier が YAML として読めるときだけ整形します。
|
|
233
237
|
usecase の native metadata は構文として解析し、プロパティを検証します。
|
|
234
238
|
- mermaid.js が許すより多くの辺を持つ flowchart は、mermaid.js は拒否しますが、
|
package/README.md
CHANGED
|
@@ -183,10 +183,13 @@ flowchart LR
|
|
|
183
183
|
- Formatting a formatted diagram again changes nothing.
|
|
184
184
|
- The content of directives, of opaque `@{ ... }` data blocks, and of the
|
|
185
185
|
frontmatter is not checked. A diagram that mermaid.js rejects because of that
|
|
186
|
-
content is still formatted. Directives
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
186
|
+
content is still formatted. Directives are kept as written. An opaque
|
|
187
|
+
`@{ ... }` data block keeps its content too; a block on one line is printed
|
|
188
|
+
with one space inside each end, and only a multi-line block that meets the
|
|
189
|
+
conditions in [Data blocks](./docs/flowchart.md#data-blocks) has all its lines
|
|
190
|
+
moved by the same number of spaces. The frontmatter is formatted only when
|
|
191
|
+
Prettier can read it as YAML. Native usecase metadata properties are parsed
|
|
192
|
+
and validated as syntax.
|
|
190
193
|
- A flowchart with more edges than mermaid.js allows, 500 by default (its
|
|
191
194
|
`maxEdges` site setting), is rejected by mermaid.js but still formatted: the
|
|
192
195
|
plugin does not know the site settings.
|
package/lib/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Comment, Node, Range, Root } from "@mmd-toolkit/parser";
|
|
2
1
|
import { AstPath, Doc, Parser, ParserOptions, Plugin, Printer, SupportLanguage } from "prettier";
|
|
2
|
+
import { Comment, Node, Range, Root } from "@mmd-toolkit/ast";
|
|
3
3
|
//#region src/printers/source.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* A comment as the printers read it: its kind, its range, and its mark. A
|