-
Notifications
You must be signed in to change notification settings - Fork 4
/
501.txt
567 lines (423 loc) · 27.7 KB
/
501.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
[1] [DFN[SuikaWiki/0.9]] は、
[[SuikaWiki2]] で主として使われている [[WikiPage]] の記法です。
[2] [[YukiWiki]]/[[WalWiki]] の記法を基本に、種々の修正を加えている。 (もはや別物か。)
* SuikaWiki/0.9 文書マーク付け書式 : 構文仕様書
** 構造
- [CODE(ABNF)[[DFN[文書]] := 頭部 本体部]]
- [29] [CODE(ABNF)[[DFN[頭部]] := '#?SuikaWiki/0.9' *(*WSP 引数) *WSP 改行]]
- [CODE(ABNF)[[DFN[引数]] := 名前 "=" <引用文字列 (中身は引数値並び)>]]
- [CODE(ABNF)[[DFN[引数値並び]] := 引数値 *("," 引数値)]]
- [CODE(ABNF)[[DFN[引数値]] := 1*(図形文字 −",")]]
引数:
:[CODE[default-name]]:既定の入力者名。 [[WikiForm]] で入力者の名前を求める場合、既定値として使用する。引数値は1つだけ指定できる。この引数の既定値は実装依存。
:[CODE[import]]:実体定義の輸入。[CODE(ABNF)[引数値]]は、 [[WikiName]] として解釈する。既定値は、「なし」。
:[CODE[interactive]]:対話的内容かどうか。値は [CODE[yes]] または [CODE[no]] (既定値)。
実際の処理は実装依存。動的に変化する [[WikiForm]] を含んでいるような場合に都合よくキャッシュ制御することを想定している。
:[CODE[obsolete]]:その WikiPage は既に廃止されているかどうか。 [CODE[yes]] または [CODE[no]] (既定値)。
:[CODE[page-icon]]:[[WikiPage]] として表示した時に [[favicon]] として使う画像を定義する WikiName。[WEAK[その WikiName の WikiPage に存在する画像かもしれないし、その WikiPage の favicon かもしれないし、その辺は実装依存。]]引数値は1つだけ指定できる。既定値は実装依存。
** ブロック水準要素
- [CODE(ABNF)[[DFN[本体部]] := *(ブロック)]]
- [CODE(ABNF)[[DFN[ブロック]] := 段落 / 見出し / 並び / 見出し付き並び / 引用 / 整形済み文 / 編集 / 表 / 空ブロック]]
- [CODE(ABNF)[[DFN[空ブロック]] := 改行]]
- [CODE(ABNF)[[DFN[段落]] := [実体参照 / フォーム] 行 改行 ブロックの続き]]
- [CODE(ABNF)[[DFN[ブロックの続き]] := 行 / 並び / 見出し付き並び / 整形済み文 / 編集 / 表]]
[CODE(ABNF)[段落]]の最初の行の一番最初に[CODE(ABNF)[実体参照]]または[CODE(ABNF)[フォーム]]があるときは、互換性のため特別扱いします。
[CODE(ABNF)[実体参照]]を置換した内容や[CODE(ABNF)[フォーム]]を HTML などで出力する時に本来なら行内要素のみである必要がありますが、
この位置にある場合はその制限が課せられません。 (ブロック水準に置換されるならブロックとして、そうでないなら行内として振舞います。)
[CODE(ABNF)[空ブロック]]は、それがなければ前のブロックに含まれてしまうがそれを望まない時に自由に挿入できます。
- [CODE(ABNF)[[DFN[見出し]] := 1*"*" *WSP 行 改行]]
見出しの水準は星一つが一番大きく、任意個の深さにできます。
途中で水準が飛んでも構いませんが、その時はその位置で暗黙のうちに
[CODE(XHTMLe)[[[section]]]] が複数個同時に始まると解釈されます。
[WEAK[一般的には文書構造として異常です。]]
- [CODE(ABNF)[[DFN[並び]] := 1*("-" / "=") *WSP 行 改行 ブロックの続き]]
- [CODE(ABNF)[[DFN[見出し付き並び]] := ":" *WSP 行 *WSP ":" *WSP 行 改行 ブロックの続き]]
最初の記号連続の、最後が "-" なら順序なし、最後が "=" なら順序付きとします。
最後以外は個数だけが重要で、種類は意味を持ちません。
[PRE[
- 順序なし A
- 順序なし B
-= 順序付き B.1
-= 順序付き B.2
-- 順序なし B.A
=- 順序なし B.B
- 順序なし C
]PRE]
水準が飛んでいてはいけませんが、実装は飛んでいても適当に扱わないといけません。
- [CODE(ABNF)[[DFN[引用]] := 1*( (1*">" *WSP 行 −(">>" 数字 行)) 改行 ブロックの続き )]]
引用符で始まる行は、引用部内のブロック境界として作用します。
[PRE[
> 段落1
段落1の続きの文
> 段落2
段落2の続きの文
]PRE]
引用符2つに[CODE(ABNF)[数字]]が続くものは[CODE(ABNF)[引用]]ではなく[CODE(ABNF)[内部リンク始点]]とみなします。
- [CODE(ABNF)[[DFN[整形済み文]] := '[PRE' [級指定] '[' *WSP 改行 *(行 改行) ']PRE]' *WSP 改行 / 廃止整形済み文]]
- [CODE(ABNF)[[DFN[廃止整形済み文]] := WSP 行 改行 *(行 改行) ;; 注 >>16, >>17]]
- [50] [DEL[[CODE(ABNF)[[DFN[編集]] := '[' ('INS' / 'DEL') [級指定] '[' *WSP 改行 本体部 ']' ('INS' / 'DEL') ']' *WSP 改行 ;; 注 >>17]]]]
- [51] [INS[[CODE(ABNF)[[DFN[編集]] := 挿入部 / 削除部]]]]
- [52] [INS[[CODE(ABNF)[[DFN[挿入部]] := '[' 'INS' [級指定] '[' *WSP 改行 本体部 ']' 'INS' ']' *WSP 改行 ;; 注 >>17]]]]
- [53] [INS[[CODE(ABNF)[[DFN[削除部]] := '[' 'DEL' [級指定] '[' *WSP 改行 本体部 ']' 'DEL' ']' *WSP 改行 ;; 注 >>17]]]]
[[空白]]で始まる行から始まるブロックは整形済みブロックとしていましたが、
非推奨とします。タグ指定方式を使ってください。
なお、最初の空白もデータの一部とします。
[16] [CODE(ABNF)[編集]]ブロック内にあるときは、直近の[CODE(ABNF)[編集]]ブロックを終わらせる終了タグがあればその[CODE(ABNF)[編集]]ブロックもろとも閉じます。
たとえば、
[PRE[
'''['''INS[
整形済み
ブロック
]INS''']'''
]PRE]
と
[PRE[
'''['''INS[
'''['''PRE[
整形済み
ブロック
]PRE''']'''
]INS''']'''
]PRE]
は同義です。
[17] 廃止でない[CODE(ABNF)[整形済み文]]は、
最初に [CODE(ABNF)[']PRE]' *WSP 改行]]
を見つけたところで終了します。
対して[CODE(ABNF)[編集]]は、入れ子に出来ます。
- [CODE(ABNF)[[DFN[表]] := 1*表の行]]
- [CODE(ABNF)[[DFN[表の行]] := 1*("," こま) 改行]]
- [DEL[[CODE(ABNF)[[DFN[こま]] := *WSP ( ( 行 − ((行 ("," / <">) 行) / "==") ) / <引用文字列 (中身は行)> / 前のこまの続きです。 ) *WSP]]]]
- [INS[[CODE(ABNF)[[DFN[こま]] := *WSP ( (行 − (<"> 行 / 行 "," 行 / 前のこまの続きです。)) / <引用文字列 (中身は行)> / 前のこまの続きです。) *WSP]] ;; 2004-01-01 訂正]]
- [CODE(ABNF)[[DFN[前のこまの続きです。]] := "=="]]
[CODE(ABNF)[前のこまの続きです。]]だけがこまの内容である時には、
直前のこまと結合します。直前のこまが連結したこまであっても構いません。
一番最初のこまが[CODE(ABNF)[前のこまの続きです。]]であるときの扱いは実装依存とします。
** 行内要素
- [CODE(ABNF)[[DFN[行]] := [終点アンカー番号] *(内部参照リンク始点 / 外部参照リンク始点 / 括弧名 / タグ付き行内要素 / フォーム / 強調 / 実体参照 / 文字データ)]]
- [CODE(ABNF)[[DFN[終点アンカー番号]] := "[" 1*数字 "]"]]
- [CODE(ABNF)[[DFN[内部参照リンク始点]] := ">>" 1*数字]]
値 [CODE[0]] が正しく扱われることは保証されません。
先導零は使用しないことが望ましいですが、実装は対応しなければなりません。
しかしそれが始点・終点で正しく一致することは保証されません。
- [CODE(ABNF)[[DFN[外部参照リンク始点]] := "<" 外部参照識別子 ">"]]
- [CODE(ABNF)[[DFN[外部参照]] := <[[URI参照]] ([[scheme]] 名は小文字でなければ'''ならない''')> / 参照方式 ":" 参照引数]]
- [CODE(ABNF)[[DFN[参照方式]] := 1*大文字]]
- [CODE(ABNF)[[DFN[参照引数]] := 1*(図形文字 ‐("<" / ">" / <">) / 引用文字列)]]
定義されている参照方式:
,参照方式名 ,参照引数の形式 ,意味
,[CODE[IW]] ,"[CODE(ABNF)[(識別子 / 引用文字列) \":\" (識別子 / 引用文字列)]] (拡張検討中)" ,"[[InterWiki]] による参照 (最初の引数が [[InterWikiName]], 2つ目の引数がそれへの引数)"
,[CODE[MAIL]] ,[CODE(ABNF)[<<RFC 2822 [[addr-spec]]> ‐<RFC 2822 obs-addr-spec> (但し最初と最後に [[FWS]] を使ってはいけない。図形文字以外も使ってはいけない。)>]] ,電子メイルの宛先
,[CODE[URI]] ,[CODE(ABNF)[<URI 参照>]] ,URI 参照。
,[CODE[URL]] ,[CODE(ABNF)[<URI 参照 (意味的に [[URL]] でなければならない。)>]] ,URL。URL 仕様書の [CODE(URI)[<URL:http://foo.example/>]] に対応。
[53] [CODE(ABNF)[参照方式名]] [CODE@en[URL]]
は、'''非推奨'''とします。代わりに [CODE@en[URI]]
または無指定とする'''べきです'''。
- [CODE(ABNF)[[DFN[括弧名]] := "[" "[" WikiName 終了タグ]]
- [CODE(ABNF)[[DFN[WikiName]] := 1*図形文字 ‐("#" *図形文字 / *図形文字 終了タグ *図形文字)]]
- [CODE(ABNF)[[DFN[タグ付き行内要素]] := 開始タグ 行内要素 *(中間タグ 行内要素) 終了タグ]]
- [CODE(ABNF)[[DFN[開始タグ]] := "[" 要素型名 [級指定] "["]]
- [CODE(ABNF)[[DFN[中間タグ]] := "]" 1*WSP "["]]
- [CODE(ABNF)[[DFN[終了タグ]] := "]" [内部参照リンク始点 / 外部参照リンク始点] "]"]]
- [CODE(ABNF)[[DFN[要素型名]] := 1*大文字]]
;;
[54] '''参考''':
[[SuikaWiki/0.10]] では[CODE(ABNF)[開始タグ]]と[CODE(ABNF)[中間タグ]]が拡張され、
[[言語札]]を指定することができます。
要素型:
,要素型名 ,級指定 ,中間タグ個数 ,内部参照リンク始点 ,外部参照リンク始点 ,意味
,[CODE[ABBR]] ,○ ,0〜1 ,× ,× ,略語
,[CODE[CODE]] ,○ ,0 ,× ,× ,符号
,[CODE[DEL]] ,○ ,0 ,○ ,○ ,削除
,[CODE[DFN]] ,○ ,0 ,× ,× ,被定義語
,[CODE[INS]] ,○ ,0 ,○ ,○ ,挿入
,[CODE[KBD]] ,○ ,0 ,× ,× ,鍵盤入力・鍵名
,[CODE[Q]] ,○ ,0 ,○ ,○ ,引用句
,[CODE[RUBY]] ,○ ,1〜2 ,× ,× ,ルビ
,[CODE[RUBYB]] ,○ ,1 ,× ,× ,従属的ルビ
,[CODE[SAMP]] ,○ ,0 ,× ,× ,例示
,[CODE[SUP]] ,○ ,0 ,× ,× ,上付き
,[CODE[SUB]] ,○ ,0 ,× ,× ,下付き
,[CODE[VAR]] ,○ ,0 ,× ,× ,変数・変化量
,[CODE[WEAK]] ,○ ,0 ,× ,× ,弱調
,括弧名 ,− ,− ,○ ,× ,語集団化
[CODE[○]]は指定可能、[CODE[×]]・[CODE[0]]
は指定に現時点で意味がないことを表します。
[CODE[INS]] および [CODE[PRE]] は、行のはじめにあるとブロック水準要素としてのそれらと紛らわしくなるので、そうしてはいけません。
[55] [[SuikaWiki/0.10]] や他の版では、 [[SuikaWiki/0.9]]
で定義されていない[[要素型名]]が定義されているかもしれません。
[[SuikaWiki/0.9]] 構文解析におけるその解釈は、
実装依存とします。
- [CODE(ABNF)[[DFN[フォーム]] := 汎用フォーム / 特定フォーム]]
- [DEL[[CODE(ABNF)[[DFN[汎用フォーム]] := "[" "[" '#form:' フォーム欄 ":" フォーム欄 [":" フォーム欄] "]" "]"]]]]
- [19] [INS[ [CODE(ABNF)[[DFN[汎用フォーム]] := "[" "[" '#form' [フォーム名指定] ":" フォーム欄 ":" フォーム欄 [":" フォーム欄] "]" "]"]]]]
- [CODE(ABNF)[[DFN[フォーム欄]] := "'" *(図形文字 −("'" / "\") / "\" 図形文字) "'"]]
- [CODE(ABNF)[[DFN[特定フォーム]] := "[" "[" "#" 名前 [":" 特定フォーム引数] "]" "]"]]
- [CODE(ABNF)[[DFN[特定フォーム引数]] := 識別子 *(":" 識別子)]]
[CODE(ABNF)[汎用フォーム]]の[CODE(ABNF)[フォーム欄]]はそれぞれ入力, 雛形, 選択肢指定です。
それぞれ [[WikiForm]] の定義により解釈します。
[56] '''フォーム名'''
- [24] [INS[[CODE(ABNF)[[DFN[フォーム名指定]] := "(" フォーム名 ")"]]]]
- [20] [INS[[CODE(ABNF)[[DFN[フォーム名]] := 1*(図形文字 − ("(" / ")"))]]]]
;;
[57] '''参考''':
[CODE(ABNF)[フォーム名]]は、技術訂正2 (>>41)
により修正されています。
[INS[
[21] [CODE(ABNF)[フォーム名]]は、そのフォームの名前です。
この名前は文書内で固有でなければなりません。
フォーム名として実際に使える構文 (文字の種類など)
は、 WikiForm の定義によります。
]INS]
現在定義されている特定フォーム:
,特定フォーム名 ,識別子部分の構文 ,意味
,[CODE[comment]] ,(使用しない) ,注釈入力欄
,[CODE[form]] ,(使用しない) ,(予約) 汎用フォーム
既に廃止された特定フォーム:
,特定フォーム名 ,識別子部分の構文 ,意味
,[CODE[embed]] ,[CODE(ABNF)[['IMG:'] 識別子]] ,引数を WikiName とみなし、 HTML 出力時にその WikiPage を埋め込む。 [CODE[IMG:]] がついているときには、画像として埋め込む。
,[CODE[rcomment]] ,(使用しない) ,注釈入力欄 (逆順)
,[CODE[searched]] ,[CODE(ABNF)[識別子]] ,HTML 出力時、引数を検索した結果をその位置に挿入
[INS[
[22] 特定フォーム名 [CODE[form]] は、汎用フォームであることを表す名前として予約しますが、
実際に[CODE(ABNF)[特定フォーム]]で使用しては'''なりません'''。
]INS]
- [DEL[[CODE(ABNF)[[DFN[強調]] := "''" (行内要素 −強調) "''" / "'''" (行内要素 −強調) "'''"]]]]
- [26] [INS[[CODE(ABNF)[[DFN[強調]] := "'" "'" (行内要素 −強調) "'" "'" / "'" "'" "'" (行内要素 −強調) "'" "'" "'"]]]]
引用符は2つよりも3つの方が強い強調とします。
- [CODE(ABNF)[[DFN[実体参照]] := "__&&" 1*(図形文字 ‐ "&") "&&__"]]
実体参照は、その名前で表される、
輸入されている実体の内容を行内要素の文脈で構文解析した結果で置換します。
(ただし、ブロックとして扱われる特別な位置の実体参照は、ブロック水準の文脈で構文解析します。)
実体の構文はその中で完結していなければなりません。例えば、[CODE(ABNF)[開始タグ]]は実体内、
[CODE(ABNF)[終了タグ]]は本文内のような曲芸はできません。
指定された実体が見つからない時の処理は実装依存です。
[59] [CODE(ABNF)[実体参照]]は、'''非推奨'''とします。
実装は、[CODE(ABNF)[実体参照]]に対応しなくても'''構いません'''。
対応しない場合に[CODE(ABNF)[実体参照]]をどう処理するかは、
実装依存とします。
[47] '''文字データ'''
- [44] [DEL[[CODE(ABNF)[[DFN[文字データ]] := 1*図形文字 ‐()]]]]
- [45] [INS[[CODE(ABNF)[[DFN[文字データ]] := 1*図形文字]]]]
他のマーク付けとみなされない文字列は、そのままの文字列として解釈します。
ただし、マークとよく似ているもののそうではない文字列の処理は実装依存とします。
たとえば、対応する[CODE(ABNF)[終了タグ]]のない[CODE(ABNF)[終了タグ]]や、
[CODE(ABNF)[開始タグ]]の最後の [CODE(ABNF)[ ] ]] が欠けたものなどの処理は不定です。
なお、 SuikaWiki/0.9 で今後新たな構文が導入されることはありません。
;;
[47] '''参考''':
従って、特に[[文字]] [CODE(char)['''[''']], [CODE(char)[''']''']],
[CODE(char)[']], [CODE(char)[<]], および [CODE(char)[>]]
を[CODE(ABNF)[文字データ]]として使用する時には注意が必要である。
** 基本字句
- [CODE(ABNF)[[DFN[識別子]] := 1*(基本ラテン文字 / 数字 / "-" / 仮名 / 漢字)]]
- [CODE(ABNF)[[DFN[名前]] := 1*(小文字 / "-")]]
- [CODE(ABNF)[[DFN[基本ラテン文字]] := 大文字 / 小文字]]
- [CODE(ABNF)[[DFN[大文字]] := 'A' / 'B' / ... / 'Y' / 'Z' ;; 26文字]]
- [CODE(ABNF)[[DFN[小文字]] := 'a' / 'b' / ... / 'y' / 'z' ;; 26文字]]
- [CODE(ABNF)[[DFN[数字]] := "0" / "1" / ... / "8" / "9" ;; 10文字]]
- [CODE(ABNF)[[DFN[仮名]] := <厳密には将来定義する。>]]
- [CODE(ABNF)[[DFN[漢字]] := <厳密には将来定義する。>]]
[37] '''引用文字列'''
- [CODE(ABNF)[[DFN[引用文字列]] := <"> *((図形文字 −("\" / <">)) / "\" 図形文字) <">]]]]
;;
[40] '''参考''':
[CODE(ABNF)[引用文字列]]に[CODE(ABNF)[改行]]を含めることはできない。
- [CODE(ABNF)[[DFN[改行]] := CRLF / CR / LF]]
[CODE(ABNF)[CRLF]] を外部正規形, [CODE(ABNF)[LF]] を内部正規形とします。
[DEL[
[60]
システム間の情報交換 ([[MIME]] や [[HTTP]] での転送を含むが、
ファイル・システムや内部データベースへの保存は含まない。)
の際には外部正規形を使います。
内部処理では内部正規形の使用を推奨します。
]DEL]
[INS[
[61]
[[SuikaWiki/0.9]] 構文解析器が [[DOM]]
またはそれに類する[[木]]を構築する場合、
[CODE(ABNF)[改行]]は内部正規形に統一する'''べきです'''。
]INS]
- [61] [DEL[[CODE(ABNF)[[DFN[級指定]] := "(" *(図形文字 −("(" / ")" / "\")) ")"]]]]
- [62] [INS[[CODE(ABNF)[[DFN[級指定]] := "(" 級並び ")"]]]]
- [66] [INS[[CODE(ABNF)[[DFN[級並び]] := *(図形文字 −("(" / ")" / "\" / "[" / "]")) −"0"]]]]
[DEL[
[63]
級指定の中身は XML 的[[名前字句並び]]になっていないといけません。
但し、 [CODE[0]] だけ (つまり級指定 [CODE[(0)]]) は不可とします。
]DEL]
[INS[
[64]
[CODE(ABNF)[級指定]]は、[[HTML]] の [CODE(HTMLa)@en[[[class]]]]
[[属性]]に相当します。
[65]
[CODE(ABNF)[級並び]]は、互換性のため、[[XML 1.0]] の[[名前字句並び]]
([CODE(XML)@en[[[NMTOKENS]]]]) である'''べきです'''。
]INS]
* 符号化文字集合
[5] SuikaWiki/0.9 文書の表現に使用する[[符号化文字集合]]は特に規定しません。
ただし、最低限 [[ISO/IEC 646]] の[[国際基準版]]の文字集合を含んでいないと非実用的でしょう。
転送プロトコル等ではそのプロトコルによって使用している符号化方式を識別します。
* 書式識別子
** インターネット媒体型
[6] [[MIME]] や [[HTTP]] などで使用する[[媒体型]]としては、
[CODE(MIME)[[[text/x-suikawiki]]]] を使います。
([CODE(MIME)[[[text/[VAR[*]]]]]] を使っていい程度に人間可読でしょう。)
[7] 媒体型引数:
,引数名 ,引数値 ,既定値 ,説明
,[CODE(MIME)[[[charset]]]] ,[CODE(ABNF)[MIME.charset]] ,(必須) ,Charset。
,[CODE(MIME)[[[version]]]] ,[CODE(ABNF)[HTTP.[[token]]]] ,(必須) ,版。 [CODE(MIME)[0.9]] でなければ'''ならない'''。
[8] なお、 MIME で使うときには本文が正規化の対象になります。
[27] [CODE(MIME)[charset]] 引数は、
内部データベースでの蓄積や他のマーク付け言語の文書内の埋め込み、
あるいは [CODE(HTTP)[[[Accept]]]] 欄などで必要がないか、あると有害な時には省略しても構いません。
そうでない場合 ([[MIME]] や [[HTTP]] 一般)
では必須です。
[67]
実装は、[CODE(MIME)@en[[[version]]]] [[引数]]と[CODE(ABNF)[頭部]]で指定された版が異なる場合、
[CODE(MIME)@en[[[version]]]] [[引数]]の指定を優先しなければ'''なりません'''。
[68]
実装は、処理しようとする[[実体]]の
[CODE(MIME)@en[[[version]]]] [[引数]]の値が
[CODE(MIME)[0.9]] の時、その[[実体本体]]を処理しなければ'''なりません'''。
それ以外の値の時、その[[実体本体]]を処理しても'''構いません'''。
[[#comment]]
** 拡張子
[9] [[Windoze]] などで[[ファイル名]]に使用する[[拡張子]]は、特に決まっていません。
[[SuikaWiki]] の実装では、 [[YukiWiki]] 以来の伝統 (or 惰性) で
[CODE(file)[.txt]] になっています。
[[#comment]]
* 技術訂正
** 技術訂正1
[28] 生成規則[CODE(ABNF)[頭部]] (>>29) を、次のとおり置き換える。
- [30] [CODE(ABNF)[[DFN[頭部]] := ['#?SuikaWiki/0.9' *(*WSP 引数) *WSP 改行] ;; 技術訂正 >>28 で修正]]
;;
[34]
'''参考''':
[[マーク付け言語]]の版および[CODE(ABNF)[引数]]として記述されていた情報は、
外部の[[メタ情報]]として記述するべきであり、
[CODE(ABNF)[文書]]内には含めないのがよい。
;;
[35]
'''参考''':
[[SuikaWiki/0.9]] に画像埋込み機能を追加した
[[SuikaWikiImage/0.9]] では、[CODE(ABNF)[頭部]]の
[CODE(ABNF)['#?SuikaWiki/0.9']] の部分を
[CODE(ABNF)['#?SuikaWikiImage/0.9']] とし、
[CODE(ABNF)[引数]]を記述する必要がある。
従って、 [[SuikaWikiImage/0.9]] では[CODE(ABNF)[頭部]]を空にできない。
;;
[36]
'''参考''':
[[SuikaWiki/0.10]] では、[CODE(ABNF)[頭部]]は空でなければならない。
** 技術訂正2
[57] [CODE(ABNF)[フォーム名]] (>>20) を、
次の通り置き換えます。
-[41] [INS[[CODE(ABNF)[[DFN[フォーム名]] := 1*(図形文字 −("(" / ")" / "\" / "'" / "[" / "]" / ":"))]]]]
;;
[58] '''参考''':
この変更は、構文解析を容易にするためのものです。
* 修正履歴
[10] [WEAK[2003-12-12 14:24:32 +00:00]] ''[[わかば]]'': 今更ですが、構文を [[ABNF]] でちゃんと書いてみました。[WEAK[新しい実装がほぼできたので、それを元に整理しました。]]
[11] 拡張可能部分のうち、[CODE(ABNF)[頭部]]の[CODE(ABNF)[引数]]と、[CODE(ABNF)[要素型]]の種類については確定で、今後追加しません。[CODE(ABNF)[要素型]]の引数の解釈 ([CODE(ABNF)[外部参照リンク始点]]とかに意味を持たせるか) や[CODE(ABNF)[参照方式]]や[CODE(ABNF)[特定フォーム]]の種類はまだ検討の余地があります。
[13] >>10-11 [CODE(ABNF)[頭部]][CODE(ABNF)[引数]] [CODE(wiki)[interactive]]
が抜けていたので追加しました。
新たに[CODE(ABNF)[外部参照リンク始点]]の[CODE(ABNF)[参照方式]]に [CODE(wiki)[URI]] を追加しました。
[14] 2004年1月1日: [CODE(ABNF)[こま]]の定義に誤りが見つかったので訂正しました。
[CODE(ABNF)[引用文字列]]ではない[CODE(ABNF)[こま]]には二重引用符
([CODE(ABNF)[<">]]) を含められないように定義していましたが、
従来の実装や文書ではこれを認めていました。
そこで、二重引用符を認めないのは最初の1文字だけとしました。
[17] 2004年1月1日: 注記 >>16
を追加。
なお、[CODE(ABNF)[廃止整形済み文]]の閉じられる場所の実装は
SuikaWiki 1 以来安定していません。
一文字目に非空白文字がくる行の直前で終わることにしていたときもありました。
>>16 の規定は、 (たぶん) SuikaWiki 2
の最新の実装と一致します。
SuikaWiki 3 の最新版もそう実装しています。
[25] 2004年1月30日:
>>20-26 を追加・修正しました。
- >>20 [CODE(ABNF)[汎用フォーム]]の定義で、
[CODE(ABNF)[フォーム名指定]]が抜けていました。
- >>21,>>24 生成規則[CODE(ABNF)[フォーム名]], [CODE(ABNF)[フォーム名指定]]を追加しました。
- >>22 [CODE(ABNF)[フォーム名]]についての規定を追加しました。
- 予約の特定フォーム名 [CODE[form]] を表に加えました。
>>23 それに関する規定を追加しました。
- >>26 [CODE(ABNF)[強調]]の式が SuikaWiki/0.9 的に解釈されてしまうので、表現を変更しました。
[31] 2004年6月13日: 技術訂正 >>28。
この修正は、 [Q[#?SuikaWiki/0.9]] の魔法行を必須ではないことにします。
SuikaWiki2 以来、旧来の文書との互換性のために、
魔法行がなくても SuikaWiki/0.9 形式と認めてきました。
また、 SuikaWiki3 の新しい実装では[[媒体型]]を魔法行ではなく外部情報で判断するので、
魔法行を含める必然性がなくなりました。
これらの理由から、 [Q[#?SuikaWiki/0.9]] は省略してよいこととします。
[32] 2004年8月8日: >>16 の例示の一部が SuikaWiki/0.9
のタグと認識されてしまうので修正しました。
[70] '''2006年5月5日''':
>>34-69 を削除とマーク付けまたは追加しました。
変更点は:
- ほぼ任意の文字が認められる部分で例外的に禁止される文字を追加
- [CODE(ABNF)[実体参照]]など使われなくなったものを非推奨扱いに変更
- [[魔法行]]より [CODE(MIME)@en[[[version]]]]
[[属性]]が優先することを明記
- [CODE(MIME)@en[[[version]]]] [[属性]]を無視してよいことを明記
- [CODE(ABNF)[改行]]の扱いを、現実の実装に合わせて変更
[[#comment]]
* メモ
[3] >>2 もはや非互換だけど、構文解析の基本方針は概ね同じ。大体上位互換だから、 SuikaWiki から YukiWiki にもってけば (ごみは出るけど) それなりにつかいもんになる程度には互換性はあるはず。
[12] [WEAK[2003-12-12 14:35:39 +00:00]] ''>>3'': なんて書いていましたけど、 SuikaWiki 3 の新しい実装では完全に書き直してしまいました。とはいっても以前とほとんど互換性があります。[WEAK[誤り処理の仕方は違います。]] SuikaWiki/0.9 と YukiWiki の書式の互換性は、確かに >>3 の通りですけど、情報劣化を考えると非現実的です。 YukiWiki→SuikaWiki/0.9 はそのままでほとんどの場合 OK でしょうが、最新の YukiWiki で導入された plugin の仕組みは互換性がありませんから駄目です。
[15] 古い文書では[CODE(ABNF)[頭部]]が存在しませんから、実装は存在しない文書も扱えるとよいかもしれません。また、内部処理形式等としては[CODE(ABNF)[本体部]]だけを処理することとしてもいいでしょう。[CODE(ABNF)[頭部]]が [CODE[SuikaWiki/0.9]] だけ (先頭に [CODE[#?]] がない。) の形式が一時期使われていましたが、実装はこの形式に対応する必要はありません。 (SuikaWiki 2 も、かなり昔に切り捨てています。 SuikaWiki 3 はそもそも未対応。最初の段落とみなします。)
[18] [CODE(ABNF)[編集]]ブロック内に[CODE(ABNF)[見出し]]が入ると、実装によってはうまく扱えないことがあります。
たとえば、
[PRE[
* 第2章
** 2.1
あいうえお。
'''['''INS[
** 2.2
かきくけこ。
]INS''']'''
]PRE''']'''
は、 SuikaWiki 2 では思った通りの結果が得られますが、 SuikaWiki 3 では
[CODE[]]
* 第2章
** 2.1
あいうえお。
'''['''INS[
]INS''']'''
*** 2.2
かきくけこ。
]PRE]
となってしまいます。
これは、 SuikaWiki 3 で内部的に行っている節の処理との相性が悪いために起こります。 SuikaWiki 3 は内部的に
[PRE[
'''['''section[
'''['''heading[
第2章
]heading''']'''
'''['''section[
'''['''heading[
2.1
]heading''']'''
あいうえお。
'''['''INS[
]INS''']'''
'''['''section[
'''['''heading[
2.2
]heading''']'''
かきくけこ。
]section''']'''
]section''']'''
]section''']'''
]PRE]
と扱うからです。 [CODE['''['''INS[]]
の直前で節を閉じることが出来れば思った通りの結果が得られるはずですが、
SuikaWiki/0.9 では陽に閉じる方法がありません。
SuikaWiki/0.9 仕様の立場としては、
この例のような文書の書き方は望ましくなく、
[WEAK[(SuikaWiki/0.9 で表現できる範囲を超えており、)]]
どう処理されるかは実装依存としておきます。
[33]
仕様書の構文にいくつか間違いが見つかっているので修正を検討中です。。。
([[名無しさん]] [WEAK[2005-02-03 22:46:34 +00:00]])