prettier-plugin-mmd 0.1.0 → 0.3.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 CHANGED
@@ -184,8 +184,10 @@ flowchart LR
184
184
  - `useTabs` と `tabWidth` で字下げを決めます。
185
185
  既定は空白 2 つです。
186
186
  - `endOfLine` で改行コードを決めます。
187
- - `printWidth` は効きません。
188
- 行を折り返すことはありません。
187
+ - `printWidth` は図の改行位置を決めません。
188
+ `railroad-beta` の呼び出しは文法の構造に従います。
189
+ 詳細は[長い行](./docs/railroad.ja.md#長い行)を参照してください。
190
+ Markdown と YAML frontmatter には、Prettier が使う場合があります。
189
191
 
190
192
  ## 整形しない場合
191
193
 
@@ -209,16 +211,24 @@ flowchart LR
209
211
 
210
212
  ## 保証と制限
211
213
 
212
- - 整形で図は変わりません。
213
- mermaid.js は、整形の前と後で同じ図を読みます。
214
- - 例外が 1 つあります。
215
- `style`、`classDef`、`linkStyle` の行の末尾の空白を取り除きます。
214
+ - 次に記す空白の変更を除き、mermaid.js の読み取りを保ちます。
215
+ - `style`、`classDef`、`linkStyle` の行の末尾の空白を取り除きます。
216
216
  mermaid.js は、その空白を最後のスタイルの末尾に残します。
217
+ - `eventmodeling` の block data と note は、
218
+ [Data blocks](./docs/eventmodeling.ja.md#data-blocks) の規則で、
219
+ ASCII 空白の margin を限定的に変更します。
220
+ 描画を保ちながら、raw Db 値が変わる場合があります。
221
+ - `end note` で閉じる state ノートの単一の段落は、
222
+ [ノート](./docs/state.ja.md#ノート)の限定規則に従います。
223
+ 行内の強調やコードの表記を含む行も対象です。
224
+ 描画を保ちながら、
225
+ `notes[].text` の行頭の ASCII 空白だけが変わる場合があります。
226
+ 余白が表示に影響するほかの本文は、後続の余白を原文のまま保ちます。
217
227
  - 整形した図をもう一度整形しても、何も変わりません。
218
228
  - ディレクティブ、不透明な `@{ ... }` のデータブロック、
219
229
  フロントマターの中身は検査しません。
220
230
  その中身のために mermaid.js が拒否する図も整形します。
221
- ディレクティブとデータブロックは書かれたまま残し、
231
+ ディレクティブと不透明な `@{ ... }` データブロックは書かれたまま残し、
222
232
  フロントマターは Prettier が YAML として読めるときだけ整形します。
223
233
  usecase の native metadata は構文として解析し、プロパティを検証します。
224
234
  - mermaid.js が許すより多くの辺を持つ flowchart は、mermaid.js は拒否しますが、
package/README.md CHANGED
@@ -145,7 +145,10 @@ flowchart LR
145
145
 
146
146
  - `useTabs` and `tabWidth` set the indentation. The default is two spaces.
147
147
  - `endOfLine` sets the line endings.
148
- - `printWidth` has no effect: lines are never wrapped.
148
+ - `printWidth` does not control diagram line breaks. `railroad-beta` calls
149
+ follow their grammar structure; see
150
+ [Long lines](./docs/railroad.md#long-lines). Prettier can still use it for
151
+ Markdown and YAML frontmatter.
149
152
 
150
153
  ## When a diagram is not formatted
151
154
 
@@ -164,16 +167,26 @@ flowchart LR
164
167
 
165
168
  ## Guarantees and limitations
166
169
 
167
- - Formatting does not change the diagram: mermaid.js reads the same diagram
168
- before and after.
169
- - One exception: whitespace at the end of a `style`, `classDef`, or `linkStyle`
170
- line is removed. mermaid.js keeps it at the end of the last style.
170
+ - Formatting preserves what mermaid.js reads, apart from the documented
171
+ whitespace changes below.
172
+ - Whitespace at the end of a `style`, `classDef`, or `linkStyle` line is
173
+ removed. mermaid.js keeps it at the end of the last style.
174
+ - For `eventmodeling` block data and notes, the
175
+ [Data blocks](./docs/eventmodeling.md#data-blocks) rule permits a restricted
176
+ ASCII space margin adjustment. This can change raw Db values while preserving
177
+ the rendered diagram.
178
+ - Single paragraphs in state notes closed by `end note` follow the restricted
179
+ [Notes](./docs/state.md#notes) rule, including lines with inline emphasis and
180
+ code notation. Only leading ASCII spaces may change in `notes[].text`, while
181
+ the rendered diagram stays the same. Other margin-sensitive bodies keep their
182
+ later margins as written.
171
183
  - Formatting a formatted diagram again changes nothing.
172
184
  - The content of directives, of opaque `@{ ... }` data blocks, and of the
173
185
  frontmatter is not checked. A diagram that mermaid.js rejects because of that
174
- content is still formatted. Directives and data blocks are kept as written;
175
- the frontmatter is formatted only when Prettier can read it as YAML. Native
176
- usecase metadata properties are parsed and validated as syntax.
186
+ content is still formatted. Directives and opaque `@{ ... }` data blocks are
187
+ kept as written; the frontmatter is formatted only when Prettier can read it
188
+ as YAML. Native usecase metadata properties are parsed and validated as
189
+ syntax.
177
190
  - A flowchart with more edges than mermaid.js allows, 500 by default (its
178
191
  `maxEdges` site setting), is rejected by mermaid.js but still formatted: the
179
192
  plugin does not know the site settings.