@markuplint/html-spec 5.0.0-alpha.1 → 5.0.0-alpha.2

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.
@@ -2,9 +2,9 @@
2
2
 
3
3
  ## 概要
4
4
 
5
- `@markuplint/html-spec` は HTML Living Standard のデータセットプロバイダです。TypeScript ソースコードを含まない純粋なデータパッケージであり、177 個の要素 JSON 仕様ファイルと 2 個の共通定義ファイルから構成されます。
5
+ `@markuplint/html-spec` は HTML Living Standard のデータセットプロバイダです。TypeScript ソースコードを含まない純粋なデータパッケージであり、208 個の要素 JSON 仕様ファイル(HTML、SVG、MathML)と 2 個の共通定義ファイルから構成されます。
6
6
 
7
- ビルド時に `@markuplint/spec-generator` が外部ソース(MDN、W3C ARIA 1.1/1.2/1.3、HTML Living Standard、SVG 仕様)からデータをフェッチし、手動で管理されたローカル仕様とマージして、統合された `index.json`(48,000 行以上、約 1.4MB)を生成します。手動データは常に外部データより優先され、仕様の正確性を保証します。
7
+ ビルド時に `@markuplint/spec-generator` が外部ソース(MDN、W3C ARIA 1.1/1.2/1.3、HTML Living Standard、SVG 仕様、MathML 仕様)からデータをフェッチし、手動で管理されたローカル仕様とマージして、統合された `index.json`(48,000 行以上、約 1.4MB)を生成します。手動データは常に外部データより優先され、仕様の正確性を保証します。
8
8
 
9
9
  ## ディレクトリ構成
10
10
 
@@ -12,10 +12,11 @@
12
12
  src/
13
13
  ├── spec.a.jsonc # <a> 要素の仕様
14
14
  ├── spec.abbr.jsonc # <abbr> 要素の仕様
15
- ├── ... (計 177 個の要素仕様ファイル)
15
+ ├── ... (計 208 個の要素仕様ファイル)
16
16
  ├── spec.svg_text.jsonc # <svg:text> 要素の仕様
17
- ├── spec-common.attributes.jsonc # 19 個のグローバル属性カテゴリ定義
18
- └── spec-common.contents.jsonc # HTML 10 + SVG 19 のコンテンツモデルカテゴリ定義
17
+ ├── spec.mml_math.jsonc # <mml:math> 要素の仕様
18
+ ├── spec-common.attributes.jsonc # 20 個のグローバル属性カテゴリ定義
19
+ └── spec-common.contents.jsonc # HTML 10 + SVG 19 + MathML 3 のコンテンツモデルカテゴリ定義
19
20
 
20
21
  build.mjs # @markuplint/spec-generator を呼び出すビルドスクリプト
21
22
  index.json # 生成出力(48K 行以上、編集不可)
@@ -32,7 +33,7 @@ flowchart TD
32
33
  subgraph sources ["ソースデータ"]
33
34
  specFiles["src/spec.*.jsonc\n(177 個の要素仕様)"]
34
35
  commonAttrs["src/spec-common.attributes.jsonc\n(19 グローバル属性カテゴリ)"]
35
- commonContents["src/spec-common.contents.jsonc\n(HTML 10 + SVG 19 コンテンツモデル)"]
36
+ commonContents["src/spec-common.contents.jsonc\n(HTML 10 + SVG 19 + MathML 3 コンテンツモデル)"]
36
37
  end
37
38
 
38
39
  subgraph build ["ビルドパイプライン"]
@@ -45,6 +46,7 @@ flowchart TD
45
46
  aria["W3C ARIA\n(1.1 / 1.2 / 1.3)"]
46
47
  htmlLs["HTML Living Standard"]
47
48
  svg["SVG 仕様"]
49
+ mathml["MathML 仕様"]
48
50
  end
49
51
 
50
52
  subgraph output ["生成出力"]
@@ -66,6 +68,7 @@ flowchart TD
66
68
  aria --> specGen
67
69
  htmlLs --> specGen
68
70
  svg --> specGen
71
+ mathml --> specGen
69
72
 
70
73
  specGen -->|"手動データ優先で\n外部データとマージ"| indexJson
71
74
 
@@ -86,11 +89,11 @@ flowchart TD
86
89
 
87
90
  グローバル定義を格納するオブジェクトです。
88
91
 
89
- | キー | 内容 |
90
- | ---------------- | -------------------------------------------------------------------- |
91
- | `#globalAttrs` | 19 個のグローバル属性カテゴリ(`#HTMLGlobalAttrs` 等) |
92
- | `#aria` | バージョン別 ARIA 定義(1.1, 1.2, 1.3) |
93
- | `#contentModels` | コンテンツモデルカテゴリマクロ(HTML 10 カテゴリ + SVG 19 カテゴリ) |
92
+ | キー | 内容 |
93
+ | ---------------- | ---------------------------------------------------------------------- |
94
+ | `#globalAttrs` | 20 個のグローバル属性カテゴリ(`#HTMLGlobalAttrs` 等) |
95
+ | `#aria` | バージョン別 ARIA 定義(1.1, 1.2, 1.3) |
96
+ | `#contentModels` | コンテンツモデルカテゴリマクロ(HTML 10 + SVG 19 + MathML 3 カテゴリ) |
94
97
 
95
98
  ### `specs`
96
99
 
@@ -114,7 +117,7 @@ export = json;
114
117
 
115
118
  | コンポーネント | ファイル | 説明 |
116
119
  | -------------- | --------------------------------------- | ------------------------------------------------------------- |
117
- | ソース仕様 | `src/spec.*.jsonc`(177 ファイル) | 要素ごとの仕様定義(コンテンツモデル、属性、ARIA マッピング) |
120
+ | ソース仕様 | `src/spec.*.jsonc`(208 ファイル) | 要素ごとの仕様定義(コンテンツモデル、属性、ARIA マッピング) |
118
121
  | 共通定義 | `src/spec-common.*.jsonc`(2 ファイル) | グローバル属性カテゴリとコンテンツモデルマクロの共有定義 |
119
122
  | ビルドシステム | `build.mjs` | `@markuplint/spec-generator` の `main()` を呼び出すエントリー |
120
123
  | 生成出力 | `index.json` | 統合データセット(48K 行以上、直接編集不可) |
@@ -179,6 +182,7 @@ export = json;
179
182
 
180
183
  - **HTML カテゴリ**(10 個): `#metadata`, `#flow`, `#sectioning`, `#heading`, `#phrasing`, `#embedded`, `#interactive`, `#palpable`, `#scriptSupporting`, `#formAssociated`
181
184
  - **SVG カテゴリ**(19 個): `#SVGAnimation`, `#SVGDescriptive`, `#SVGShape`, `#SVGStructural` 等
185
+ - **MathML カテゴリ**(3 個): `#MathMLPresentation`, `#MathMLScript`, `#MathMLTabular`
182
186
 
183
187
  ## ビルドパイプライン
184
188
 
@@ -199,7 +203,7 @@ await main({
199
203
  ビルドプロセスの流れ:
200
204
 
201
205
  1. `src/spec.*.jsonc` と `src/spec-common.*.jsonc` を読み込む
202
- 2. MDN、W3C ARIA(1.1/1.2/1.3)、HTML Living Standard、SVG 仕様から外部データをフェッチ
206
+ 2. MDN、W3C ARIA(1.1/1.2/1.3)、HTML Living Standard、SVG 仕様、MathML 仕様から外部データをフェッチ
203
207
  3. 手動仕様と外部データをマージ(手動データが優先)
204
208
  4. 統合された `index.json` を出力
205
209
 
package/ARCHITECTURE.md CHANGED
@@ -2,9 +2,9 @@
2
2
 
3
3
  ## Overview
4
4
 
5
- `@markuplint/html-spec` is the canonical HTML Living Standard dataset provider for markuplint. It is a pure data package with no TypeScript source code. It contains 177 per-element JSON specification files and 2 common definition files that are processed by `@markuplint/spec-generator` to produce a single consolidated `index.json` (48K+ lines, 1.4MB).
5
+ `@markuplint/html-spec` is the canonical HTML Living Standard dataset provider for markuplint. It is a pure data package with no TypeScript source code. It contains 208 per-element JSON specification files (HTML, SVG, and MathML) and 2 common definition files that are processed by `@markuplint/spec-generator` to produce a single consolidated `index.json` (48K+ lines, 1.4MB).
6
6
 
7
- During the build, `@markuplint/spec-generator` fetches live data from MDN, W3C ARIA specifications (1.1, 1.2, 1.3), Graphics ARIA, DPub ARIA, HTML-ARIA mappings, the HTML Living Standard, and SVG specifications, then merges that external data with the hand-authored JSON files. Manual specifications always take precedence over fetched data, ensuring stable, curated definitions while still benefiting from automated enrichment.
7
+ During the build, `@markuplint/spec-generator` fetches live data from MDN, W3C ARIA specifications (1.1, 1.2, 1.3), Graphics ARIA, DPub ARIA, HTML-ARIA mappings, the HTML Living Standard, SVG specifications, and MathML specifications, then merges that external data with the hand-authored JSON files. Manual specifications always take precedence over fetched data, ensuring stable, curated definitions while still benefiting from automated enrichment.
8
8
 
9
9
  ## Directory Structure
10
10
 
@@ -12,10 +12,11 @@ During the build, `@markuplint/spec-generator` fetches live data from MDN, W3C A
12
12
  src/
13
13
  ├── spec.a.jsonc # <a> element specification
14
14
  ├── spec.abbr.jsonc # <abbr> element specification
15
- ├── ... (177 element specification files total)
15
+ ├── ... (208 element specification files total)
16
16
  ├── spec.svg_text.jsonc # <svg:text> element specification
17
- ├── spec-common.attributes.jsonc # 19 global attribute category definitions
18
- └── spec-common.contents.jsonc # 10 HTML + 19 SVG content model category definitions
17
+ ├── spec.mml_math.jsonc # <mml:math> element specification
18
+ ├── spec-common.attributes.jsonc # 20 global attribute category definitions
19
+ └── spec-common.contents.jsonc # 10 HTML + 19 SVG + 3 MathML content model category definitions
19
20
 
20
21
  build.mjs # Build script invoking @markuplint/spec-generator
21
22
  index.json # Generated output (48K+ lines, DO NOT EDIT)
@@ -32,7 +33,7 @@ flowchart TD
32
33
  subgraph sources ["Source Layer"]
33
34
  elemSpecs["177 element specs\n(src/spec.*.jsonc)"]
34
35
  commonAttrs["spec-common.attributes.jsonc\n(19 global attribute categories)"]
35
- commonContents["spec-common.contents.jsonc\n(10 HTML + 19 SVG content models)"]
36
+ commonContents["spec-common.contents.jsonc\n(10 HTML + 19 SVG + 3 MathML content models)"]
36
37
  end
37
38
 
38
39
  subgraph build ["Build Pipeline"]
@@ -48,6 +49,7 @@ flowchart TD
48
49
  htmlAria["HTML-ARIA Mappings"]
49
50
  htmlLS["HTML Living Standard\n(elements, attributes)"]
50
51
  svg["SVG Specification\n(elements, attributes)"]
52
+ mathml["MathML Specification\n(elements, attributes)"]
51
53
  end
52
54
 
53
55
  subgraph output ["Generated Output"]
@@ -72,6 +74,7 @@ flowchart TD
72
74
  htmlAria --> specGen
73
75
  htmlLS --> specGen
74
76
  svg --> specGen
77
+ mathml --> specGen
75
78
 
76
79
  specGen -->|"merge\n(manual takes precedence)"| indexJson
77
80
 
@@ -94,7 +97,7 @@ Global definitions shared across all element specifications.
94
97
 
95
98
  | Key | Description |
96
99
  | ---------------- | -------------------------------------------------------------------------------------------------------------------- |
97
- | `#globalAttrs` | 19 global attribute categories defining attributes available on all or specific groups of elements |
100
+ | `#globalAttrs` | 20 global attribute categories defining attributes available on all or specific groups of elements |
98
101
  | `#aria` | ARIA role and property definitions per specification version (1.1, 1.2, 1.3), plus Graphics ARIA and DPub ARIA roles |
99
102
  | `#contentModels` | Content model category macros mapping category names to their member elements |
100
103
 
@@ -120,22 +123,24 @@ Global definitions shared across all element specifications.
120
123
  | `#SVGFilterPrimitiveAttrs` | SVG filter primitive attributes |
121
124
  | `#SVGPresentationAttrs` | SVG presentation attributes |
122
125
  | `#SVGTransferFunctionAttrs` | SVG transfer function attributes |
126
+ | `#MathMLGlobalAttrs` | MathML global attributes |
123
127
  | `#XLinkAttrs` | XLink attributes |
124
128
 
125
129
  **Content Model Categories** (`#contentModels`):
126
130
 
127
131
  - **HTML (10):** `#metadata`, `#flow`, `#sectioning`, `#heading`, `#phrasing`, `#embedded`, `#interactive`, `#palpable`, `#script-supporting`, plus one empty placeholder
128
132
  - **SVG (19):** `#SVGAnimation`, `#SVGBasicShapes`, `#SVGContainer`, `#SVGDescriptive`, `#SVGFilterPrimitive`, `#SVGFont`, `#SVGGradient`, `#SVGGraphics`, `#SVGGraphicsReferencing`, `#SVGLightSource`, `#SVGNeverRendered`, `#SVGPaintServer`, `#SVGRenderable`, `#SVGShape`, `#SVGStructural`, `#SVGStructurallyExternal`, `#SVGTextContent`, `#SVGTextContentChild`, plus one empty placeholder
133
+ - **MathML (3):** `#MathMLPresentation`, `#MathMLScript`, `#MathMLTabular`
129
134
 
130
135
  ### `specs`
131
136
 
132
- An array of element specifications. Each entry defines a single HTML or SVG element with its content model, permitted attributes, ARIA role mappings, and categorization.
137
+ An array of element specifications. Each entry defines a single HTML, SVG, or MathML element with its content model, permitted attributes, ARIA role mappings, and categorization.
133
138
 
134
139
  ## Core Components
135
140
 
136
141
  | Component | Files | Purpose |
137
142
  | --------------------- | ------------------------------------------------------------ | ------------------------------------------------------------------------------ |
138
- | Source Specifications | 177 `src/spec.*.jsonc` files | Per-element definitions: content models, attributes, ARIA mappings |
143
+ | Source Specifications | 208 `src/spec.*.jsonc` files | Per-element definitions: content models, attributes, ARIA mappings |
139
144
  | Common Definitions | `spec-common.attributes.jsonc`, `spec-common.contents.jsonc` | Shared global attribute categories and content model category macros |
140
145
  | Build System | `build.mjs` | Invokes `@markuplint/spec-generator` to merge sources with external data |
141
146
  | Generated Output | `index.json` | Single consolidated dataset consumed by downstream packages |
@@ -187,7 +192,7 @@ flowchart LR
187
192
  ### Upstream
188
193
 
189
194
  - **`@markuplint/ml-spec`** provides the TypeScript type definitions (`MLMLSpec`, `ElementSpec`, `SpecDefs`) and JSON schemas used to validate the generated output. The `index.d.ts` re-exports these types.
190
- - **`@markuplint/spec-generator`** is the build tool invoked by `build.mjs`. It reads the source JSON files, fetches live data from MDN Web Docs, W3C ARIA specifications (versions 1.1, 1.2, 1.3), Graphics ARIA, DPub ARIA, HTML-ARIA mappings, the HTML Living Standard, and SVG specifications, then merges everything into `index.json`.
195
+ - **`@markuplint/spec-generator`** is the build tool invoked by `build.mjs`. It reads the source JSON files, fetches live data from MDN Web Docs, W3C ARIA specifications (versions 1.1, 1.2, 1.3), Graphics ARIA, DPub ARIA, HTML-ARIA mappings, the HTML Living Standard, SVG specifications, and MathML specifications, then merges everything into `index.json`.
191
196
 
192
197
  ### Downstream
193
198
 
package/CHANGELOG.md CHANGED
@@ -3,6 +3,12 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [5.0.0-alpha.2](https://github.com/markuplint/markuplint/compare/v5.0.0-alpha.1...v5.0.0-alpha.2) (2026-02-23)
7
+
8
+ ### Features
9
+
10
+ - **html-spec:** add 32 MathML element specifications ([2acf2e1](https://github.com/markuplint/markuplint/commit/2acf2e1f1c6f536a6de424a6b7eb6c9b9ca2c178))
11
+
6
12
  # [5.0.0-alpha.1](https://github.com/markuplint/markuplint/compare/v5.0.0-alpha.0...v5.0.0-alpha.1) (2026-02-22)
7
13
 
8
14
  ### Features
package/README.md CHANGED
@@ -35,14 +35,14 @@ Core packages (Application Layer)
35
35
 
36
36
  ### Source Files (EDIT THESE)
37
37
 
38
- - **`src/spec.*.jsonc`** - Individual element specifications (177 files)
39
- - **`src/spec-common.attributes.jsonc`** - Global attribute category definitions (19 categories)
40
- - **`src/spec-common.contents.jsonc`** - Content model category macros (HTML 10 + SVG 19 categories)
38
+ - **`src/spec.*.jsonc`** - Individual element specifications (208 files)
39
+ - **`src/spec-common.attributes.jsonc`** - Global attribute category definitions (20 categories)
40
+ - **`src/spec-common.contents.jsonc`** - Content model category macros (HTML 10 + SVG 19 + MathML 3 categories)
41
41
 
42
42
  ### Build System
43
43
 
44
44
  - **`build.mjs`** - Generation script that invokes `@markuplint/spec-generator`
45
- - Fetches live data from MDN, W3C ARIA specs, Graphics ARIA, DPub ARIA, HTML-ARIA mappings, HTML Living Standard, and SVG specs
45
+ - Fetches live data from MDN, W3C ARIA specs, Graphics ARIA, DPub ARIA, HTML-ARIA mappings, HTML Living Standard, SVG specs, and MathML specs
46
46
 
47
47
  ## Relationship to @markuplint/ml-spec
48
48
 
@@ -6,7 +6,7 @@
6
6
 
7
7
  `@markuplint/html-spec` は `@markuplint/spec-generator` を使用して、単一の統合 `index.json` ファイルを生成します。ビルドプロセス:
8
8
 
9
- 1. `src/` から 177 個の要素 JSON 仕様ファイルと 2 個の共通定義ファイルを読み込む
9
+ 1. `src/` から 208 個の要素 JSON 仕様ファイル(HTML、SVG、MathML)と 2 個の共通定義ファイルを読み込む
10
10
  2. MDN Web Docs、W3C ARIA 仕様、HTML Living Standard から外部データをフェッチ
11
11
  3. 手動仕様と外部データをマージ(手動データが常に優先)
12
12
  4. 統合結果を `index.json` に出力(約 48K 行、約 1.4MB)
@@ -18,8 +18,8 @@
18
18
  ```mermaid
19
19
  flowchart TD
20
20
  subgraph inputs ["ソースファイル(html-spec)"]
21
- specFiles["src/spec.*.jsonc\n(177 要素ファイル)"]
22
- commonAttrs["src/spec-common.attributes.jsonc\n(19 グローバル属性カテゴリ)"]
21
+ specFiles["src/spec.*.jsonc\n(208 要素ファイル)"]
22
+ commonAttrs["src/spec-common.attributes.jsonc\n(20 グローバル属性カテゴリ)"]
23
23
  commonContents["src/spec-common.contents.jsonc\n(コンテンツモデルマクロ)"]
24
24
  end
25
25
 
@@ -32,6 +32,7 @@ flowchart TD
32
32
  mdn["MDN Web Docs"]
33
33
  aria["W3C ARIA(1.1 / 1.2 / 1.3)"]
34
34
  svg["SVG / Graphics ARIA"]
35
+ mathml["MathML"]
35
36
  end
36
37
 
37
38
  subgraph output ["出力"]
@@ -46,6 +47,7 @@ flowchart TD
46
47
  mdn --> specGen
47
48
  aria --> specGen
48
49
  svg --> specGen
50
+ mathml --> specGen
49
51
 
50
52
  specGen -->|"手動データ優先で\nマージ"| indexJson
51
53
  ```
@@ -81,6 +83,7 @@ spec-generator はビルド時に以下の外部ソースからデータをフ
81
83
  | ----------------------------------------- | ------------------------------------------------------------ |
82
84
  | MDN Web Docs(HTML) | 要素の説明、コンテンツカテゴリ、属性メタデータ、互換性フラグ |
83
85
  | MDN Web Docs(SVG) | SVG 要素の説明、非推奨要素リスト |
86
+ | MDN Web Docs(MathML) | MathML 要素の説明、非推奨要素リスト |
84
87
  | WAI-ARIA 1.1(`w3.org/TR/wai-aria-1.1/`) | ロール定義、プロパティ、ステート |
85
88
  | WAI-ARIA 1.2(`w3.org/TR/wai-aria-1.2/`) | 更新されたロール定義 |
86
89
  | WAI-ARIA 1.3(`w3c.github.io/aria/`) | 最新の Editor's Draft |
@@ -127,7 +130,7 @@ spec-generator の内部アーキテクチャ(スクレイピング、キャ
127
130
  {
128
131
  cites: string[]; // フェッチされた全 URL のソート済みリスト
129
132
  def: {
130
- "#globalAttrs": { ... }, // 19 グローバル属性カテゴリ
133
+ "#globalAttrs": { ... }, // 20 グローバル属性カテゴリ
131
134
  "#aria": { // バージョン別 ARIA 定義
132
135
  "1.1": { roles, props, graphicsRoles },
133
136
  "1.2": { roles, props, graphicsRoles },
@@ -135,7 +138,7 @@ spec-generator の内部アーキテクチャ(スクレイピング、キャ
135
138
  },
136
139
  "#contentModels": { ... } // コンテンツモデルカテゴリマクロ
137
140
  },
138
- specs: ElementSpec[] // 要素仕様配列(アルファベット順、SVG は末尾)
141
+ specs: ElementSpec[] // 要素仕様配列(アルファベット順、MathML は HTML の後、SVG はその後)
139
142
  }
140
143
  ```
141
144
 
@@ -6,7 +6,7 @@ This document describes how `index.json` is generated from the source files and
6
6
 
7
7
  The `@markuplint/html-spec` package uses `@markuplint/spec-generator` to produce a single consolidated `index.json` file. The build process:
8
8
 
9
- 1. Reads 177 per-element JSON spec files and 2 common definition files from `src/`
9
+ 1. Reads 208 per-element JSON spec files (HTML, SVG, MathML) and 2 common definition files from `src/`
10
10
  2. Fetches external data from MDN Web Docs, W3C ARIA specifications, and the HTML Living Standard
11
11
  3. Merges manual specifications with external data (manual data takes precedence)
12
12
  4. Writes the consolidated output to `index.json` (~48K lines, ~1.4MB)
@@ -18,8 +18,8 @@ The build is network-dependent because external data is fetched live. Expect sev
18
18
  ```mermaid
19
19
  flowchart TD
20
20
  subgraph inputs ["Source Files (html-spec)"]
21
- specFiles["src/spec.*.jsonc\n(177 element files)"]
22
- commonAttrs["src/spec-common.attributes.jsonc\n(19 global attribute categories)"]
21
+ specFiles["src/spec.*.jsonc\n(208 element files)"]
22
+ commonAttrs["src/spec-common.attributes.jsonc\n(20 global attribute categories)"]
23
23
  commonContents["src/spec-common.contents.jsonc\n(content model macros)"]
24
24
  end
25
25
 
@@ -32,6 +32,7 @@ flowchart TD
32
32
  mdn["MDN Web Docs"]
33
33
  aria["W3C ARIA (1.1 / 1.2 / 1.3)"]
34
34
  svg["SVG / Graphics ARIA"]
35
+ mathml["MathML"]
35
36
  end
36
37
 
37
38
  subgraph output ["Output"]
@@ -46,6 +47,7 @@ flowchart TD
46
47
  mdn --> specGen
47
48
  aria --> specGen
48
49
  svg --> specGen
50
+ mathml --> specGen
49
51
 
50
52
  specGen -->|"merge\n(manual takes precedence)"| indexJson
51
53
  ```
@@ -81,6 +83,7 @@ The spec-generator fetches live data from the following sources during the build
81
83
  | ---------------------------------------- | --------------------------------------------------------------------------------- |
82
84
  | MDN Web Docs (HTML) | Element descriptions, content categories, attribute metadata, compatibility flags |
83
85
  | MDN Web Docs (SVG) | SVG element descriptions and deprecated element list |
86
+ | MDN Web Docs (MathML) | MathML element descriptions and deprecated element list |
84
87
  | WAI-ARIA 1.1 (`w3.org/TR/wai-aria-1.1/`) | Role definitions, properties, states |
85
88
  | WAI-ARIA 1.2 (`w3.org/TR/wai-aria-1.2/`) | Updated role definitions |
86
89
  | WAI-ARIA 1.3 (`w3c.github.io/aria/`) | Latest editor's draft |
@@ -128,7 +131,7 @@ The `index.json` follows the `ExtendedSpec` type from `@markuplint/ml-spec`:
128
131
  {
129
132
  cites: string[]; // Sorted list of all URLs fetched during generation
130
133
  def: {
131
- "#globalAttrs": { ... }, // 19 global attribute categories
134
+ "#globalAttrs": { ... }, // 20 global attribute categories
132
135
  "#aria": { // ARIA definitions per version
133
136
  "1.1": { roles, props, graphicsRoles },
134
137
  "1.2": { roles, props, graphicsRoles },
@@ -136,7 +139,7 @@ The `index.json` follows the `ExtendedSpec` type from `@markuplint/ml-spec`:
136
139
  },
137
140
  "#contentModels": { ... } // Content model category macros
138
141
  },
139
- specs: ElementSpec[] // Element specifications, sorted alphabetically (SVG after HTML)
142
+ specs: ElementSpec[] // Element specifications, sorted alphabetically (MathML after HTML, SVG after MathML)
140
143
  }
141
144
  ```
142
145
 
@@ -31,12 +31,25 @@ spec.svg_path.jsonc # <svg:path> 要素
31
31
 
32
32
  ファイル名のプレフィックス `svg_` から、要素名は `svg:<local>` として推論されます(例: `spec.svg_text.jsonc` は `svg:text` に対応)。
33
33
 
34
+ ### MathML 要素
35
+
36
+ ファイル名パターン: `src/spec.mml_<local>.jsonc`
37
+
38
+ ```
39
+ spec.mml_math.jsonc # <mml:math> 要素
40
+ spec.mml_mfrac.jsonc # <mml:mfrac> 要素
41
+ spec.mml_mi.jsonc # <mml:mi> 要素
42
+ spec.mml_mn.jsonc # <mml:mn> 要素
43
+ ```
44
+
45
+ ファイル名のプレフィックス `mml_` から、要素名は `mml:<local>` として推論されます(例: `spec.mml_math.jsonc` は `mml:math` に対応)。
46
+
34
47
  ### 共通定義ファイル
35
48
 
36
- | ファイル | 内容 |
37
- | ------------------------------ | -------------------------------------------------- |
38
- | `spec-common.attributes.jsonc` | グローバル属性カテゴリ定義(19 カテゴリ) |
39
- | `spec-common.contents.jsonc` | コンテンツモデルカテゴリマクロ(HTML 10 + SVG 19) |
49
+ | ファイル | 内容 |
50
+ | ------------------------------ | ------------------------------------------------------------ |
51
+ | `spec-common.attributes.jsonc` | グローバル属性カテゴリ定義(20 カテゴリ) |
52
+ | `spec-common.contents.jsonc` | コンテンツモデルカテゴリマクロ(HTML 9 + SVG 18 + MathML 3) |
40
53
 
41
54
  ## 要素仕様の構造
42
55
 
@@ -171,15 +184,16 @@ spec.svg_path.jsonc # <svg:path> 要素
171
184
 
172
185
  コンテンツモデルパターンのセレクタとして使用可能な形式です。
173
186
 
174
- | セレクタ形式 | 説明 | 例 |
175
- | -------------- | ----------------------------------- | -------------------------------------- |
176
- | タグ名 | HTML 要素名 | `"dt"`, `"dd"`, `"li"`, `"option"` |
177
- | カテゴリ参照 | `:model()` 擬似クラスによるカテゴリ | `":model(flow)"`, `":model(phrasing)"` |
178
- | 否定セレクタ | `:not()` との組み合わせ | `":not(:model(interactive), a)"` |
179
- | テキストノード | テキストコンテンツ | `"#text"` |
180
- | カスタム要素 | カスタム要素のワイルドカード | `"#custom"` |
181
- | SVG 名前空間 | パイプ記法による名前空間指定 | `"svg\|a"`, `"svg\|circle"` |
182
- | 属性セレクタ | 属性条件付き要素 | `"a[href]"`, `"link[itemprop]"` |
187
+ | セレクタ形式 | 説明 | 例 |
188
+ | --------------- | ----------------------------------- | -------------------------------------- |
189
+ | タグ名 | HTML 要素名 | `"dt"`, `"dd"`, `"li"`, `"option"` |
190
+ | カテゴリ参照 | `:model()` 擬似クラスによるカテゴリ | `":model(flow)"`, `":model(phrasing)"` |
191
+ | 否定セレクタ | `:not()` との組み合わせ | `":not(:model(interactive), a)"` |
192
+ | テキストノード | テキストコンテンツ | `"#text"` |
193
+ | カスタム要素 | カスタム要素のワイルドカード | `"#custom"` |
194
+ | SVG 名前空間 | パイプ記法による名前空間指定 | `"svg\|a"`, `"svg\|circle"` |
195
+ | MathML 名前空間 | パイプ記法による名前空間指定 | `"mml\|mi"`, `"mml\|mn"` |
196
+ | 属性セレクタ | 属性条件付き要素 | `"a[href]"`, `"link[itemprop]"` |
183
197
 
184
198
  ---
185
199
 
@@ -210,7 +224,7 @@ spec.svg_path.jsonc # <svg:path> 要素
210
224
  }
211
225
  ```
212
226
 
213
- ### 利用可能なグローバル属性カテゴリ(19 カテゴリ)
227
+ ### 利用可能なグローバル属性カテゴリ(20 カテゴリ)
214
228
 
215
229
  #### HTML カテゴリ
216
230
 
@@ -241,6 +255,12 @@ spec.svg_path.jsonc # <svg:path> 要素
241
255
  | `#SVGTransferFunctionAttrs` | SVG 転送関数属性 |
242
256
  | `#XLinkAttrs` | XLink 属性(非推奨) |
243
257
 
258
+ #### MathML カテゴリ
259
+
260
+ | カテゴリ | 説明 |
261
+ | -------------------- | -------------------------------------------------------------------------- |
262
+ | `#MathMLGlobalAttrs` | MathML グローバル属性(`dir`, `displaystyle`, `mathcolor`, `mathsize` 等) |
263
+
244
264
  ---
245
265
 
246
266
  ## `attributes`
@@ -455,6 +475,11 @@ ARIA(Accessible Rich Internet Applications)統合仕様を定義します。
455
475
  "core-aam": true,
456
476
  "graphics-aam": true
457
477
  }
478
+
479
+ // AAM 参照(MathML 要素で使用)
480
+ "permittedRoles": {
481
+ "mathml-aam": true
482
+ }
458
483
  ```
459
484
 
460
485
  ### `conditions`
@@ -522,7 +547,7 @@ ARIA 仕様のバージョンごとに異なるマッピングを定義できま
522
547
 
523
548
  `spec-common.contents.jsonc` に定義されるカテゴリマクロです。コンテンツモデルパターンのセレクタで `:model(<category>)` の形式で参照されます。
524
549
 
525
- ### HTML カテゴリ(10
550
+ ### HTML カテゴリ(9
526
551
 
527
552
  | カテゴリ | 説明 | 代表的な要素 |
528
553
  | -------------------- | ---------------------------------------- | ------------------------------------------------------------- |
@@ -536,7 +561,7 @@ ARIA 仕様のバージョンごとに異なるマッピングを定義できま
536
561
  | `#palpable` | 実質的なコンテンツをレンダリングする要素 | `a`, `div`, `p`, `img`, `table` 等 |
537
562
  | `#script-supporting` | スクリプトサポート要素 | `script`, `template` |
538
563
 
539
- ### SVG カテゴリ(19
564
+ ### SVG カテゴリ(18
540
565
 
541
566
  | カテゴリ | 説明 | 代表的な要素 |
542
567
  | -------------------------- | ------------------------ | -------------------------------------------------------------- |
@@ -559,13 +584,21 @@ ARIA 仕様のバージョンごとに異なるマッピングを定義できま
559
584
  | `#SVGTextContent` | テキストコンテンツ要素 | `svg\|text`, `svg\|textPath`, `svg\|tspan` |
560
585
  | `#SVGTextContentChild` | テキストコンテンツ子要素 | `svg\|textPath`, `svg\|tref`, `svg\|tspan` |
561
586
 
587
+ ### MathML カテゴリ(3)
588
+
589
+ | カテゴリ | 説明 | 代表的な要素 |
590
+ | --------------------- | ----------------------------- | --------------------------------------------------------------------- |
591
+ | `#MathMLPresentation` | MathML プレゼンテーション要素 | `mml\|mi`, `mml\|mn`, `mml\|mo`, `mml\|mfrac`, `mml\|msqrt` |
592
+ | `#MathMLScript` | MathML スクリプト要素 | `mml\|msub`, `mml\|msup`, `mml\|msubsup`, `mml\|munder`, `mml\|mover` |
593
+ | `#MathMLTabular` | MathML テーブル要素 | `mml\|mtable`, `mml\|mtr`, `mml\|mtd` |
594
+
562
595
  ---
563
596
 
564
597
  ## 共通定義ファイル
565
598
 
566
599
  ### `spec-common.attributes.jsonc`
567
600
 
568
- 19 個のグローバル属性カテゴリの定義ファイルです。各カテゴリはキーに `#` プレフィックス付きの名前を持ち、値は属性名から属性定義へのマッピングです。
601
+ 20 個のグローバル属性カテゴリの定義ファイルです。各カテゴリはキーに `#` プレフィックス付きの名前を持ち、値は属性名から属性定義へのマッピングです。
569
602
 
570
603
  ```jsonc
571
604
  {
@@ -856,6 +889,36 @@ ARIA 仕様のバージョンごとに異なるマッピングを定義できま
856
889
  }
857
890
  ```
858
891
 
892
+ ### MathML 要素(`<mml:mfrac>`)
893
+
894
+ ```jsonc
895
+ // https://w3c.github.io/mathml-core/#fractions-mfrac
896
+ {
897
+ "contentModel": {
898
+ "contents": [{ "oneOrMore": ":model(MathMLPresentation)", "max": 2 }],
899
+ },
900
+ "globalAttrs": {
901
+ "#HTMLGlobalAttrs": true,
902
+ "#GlobalEventAttrs": true,
903
+ "#ARIAAttrs": true,
904
+ "#MathMLGlobalAttrs": true,
905
+ },
906
+ "attributes": {},
907
+ "aria": {
908
+ "implicitRole": false,
909
+ "permittedRoles": { "mathml-aam": true },
910
+ },
911
+ }
912
+ ```
913
+
914
+ MathML 要素は HTML 要素と比較して以下の特徴があります。
915
+
916
+ - **コンテンツモデル**: MathML カテゴリ(`:model(MathMLPresentation)` 等)を使用。`max` フィールドで子要素の最大数を制約可能(例: `<mfrac>` は分子と分母の2つのみ)
917
+ - **グローバル属性**: MathML 固有のカテゴリ(`#MathMLGlobalAttrs`)をインクルード
918
+ - **ARIA**: `permittedRoles` で MathML-AAM 参照オブジェクト(`mathml-aam`)を使用
919
+
920
+ ---
921
+
859
922
  SVG 要素は HTML 要素と比較して以下の特徴があります。
860
923
 
861
924
  - **コンテンツモデル**: SVG カテゴリ(`:model(SVGAnimation)` 等)とパイプ記法による名前空間指定(`svg|a`)を使用
@@ -949,4 +1012,5 @@ SVG 要素は HTML 要素と比較して以下の特徴があります。
949
1012
  | 条件付き ARIA | `conditions` オブジェクト | `<a>` の href 依存ロール |
950
1013
  | バージョン固有 ARIA | `"1.1"`, `"1.2"` キー | ARIA バージョン間の差異 |
951
1014
  | SVG 名前空間 | `svg\|` プレフィックス | SVG 要素のコンテンツモデル |
1015
+ | MathML 名前空間 | `mml\|` プレフィックス | MathML 要素のコンテンツモデル |
952
1016
  | カテゴリ参照 | `:model()` 擬似クラス | コンテンツモデルパターン |
@@ -18,9 +18,15 @@ Pattern: `src/spec.svg_<local>.jsonc` (e.g., `spec.svg_text.jsonc`, `spec.svg_ci
18
18
  The local name preserves case (`svg_animateMotion.jsonc`). The element name is inferred
19
19
  at runtime as `svg:<local>` (e.g., `svg:text`, `svg:clipPath`).
20
20
 
21
+ ### MathML Elements
22
+
23
+ Pattern: `src/spec.mml_<local>.jsonc` (e.g., `spec.mml_math.jsonc`, `spec.mml_mfrac.jsonc`)
24
+
25
+ The element name is inferred at runtime as `mml:<local>` (e.g., `mml:math`, `mml:mfrac`).
26
+
21
27
  ### Common Files
22
28
 
23
- - `spec-common.attributes.jsonc` -- Global attribute category definitions (19 categories)
29
+ - `spec-common.attributes.jsonc` -- Global attribute category definitions (20 categories)
24
30
  - `spec-common.contents.jsonc` -- Content model category macros
25
31
 
26
32
  ### JSON with Comments
@@ -127,6 +133,7 @@ element inherits its parent's content model, excluding elements matching the sel
127
133
  | `"#text"` | Text nodes |
128
134
  | `"#custom"` | Custom elements |
129
135
  | `"svg\|a"`, `"svg\|circle"` | SVG namespace elements |
136
+ | `"mml\|mi"`, `"mml\|mn"` | MathML namespace elements |
130
137
  | `"link[itemprop]"` | Attribute selectors |
131
138
 
132
139
  ## Global Attributes
@@ -148,7 +155,7 @@ The `globalAttrs` object maps category names (prefixed with `#`) to inclusion ru
148
155
  }
149
156
  ```
150
157
 
151
- ### Available Categories (19)
158
+ ### Available Categories (20)
152
159
 
153
160
  | Category | Description |
154
161
  | ----------------------------------- | ------------------------------------------------------------------- |
@@ -171,6 +178,7 @@ The `globalAttrs` object maps category names (prefixed with `#`) to inclusion ru
171
178
  | `#SVGPresentationAttrs` | SVG presentation attributes (fill, stroke, transform, etc.) |
172
179
  | `#SVGTransferFunctionAttrs` | SVG transfer function attributes |
173
180
  | `#XLinkAttrs` | XLink attributes (deprecated) |
181
+ | `#MathMLGlobalAttrs` | MathML global attributes (dir, displaystyle, mathcolor, etc.) |
174
182
 
175
183
  ## Element-Specific Attributes
176
184
 
@@ -307,7 +315,7 @@ The `aria` object defines ARIA role and property integration.
307
315
  - `true` -- Any role is permitted
308
316
  - `false` -- No explicit roles permitted
309
317
  - `string[]` -- Specific permitted role names
310
- - Object with AAM references (SVG): `{ "core-aam": true, "graphics-aam": true }`
318
+ - Object with AAM references (SVG/MathML): `{ "core-aam": true, "graphics-aam": true }` or `{ "mathml-aam": true }`
311
319
 
312
320
  Role entries can also be objects: `{ "name": "directory", "deprecated": true }`.
313
321
 
@@ -356,7 +364,7 @@ spec versions. Version overrides can contain their own `conditions` object:
356
364
 
357
365
  ### spec-common.attributes.jsonc
358
366
 
359
- Defines the 19 global attribute categories. Each category maps attribute names to
367
+ Defines the 20 global attribute categories. Each category maps attribute names to
360
368
  definitions using the same format described in the attributes section.
361
369
 
362
370
  ### spec-common.contents.jsonc
@@ -369,7 +377,7 @@ Defines content model category macros referenced via `:model()`. Structure:
369
377
 
370
378
  ### Content Model Categories
371
379
 
372
- **HTML categories (10):**
380
+ **HTML categories (9):**
373
381
 
374
382
  | Category | Description |
375
383
  | -------------------- | ---------------------------------------------------------- |
@@ -383,7 +391,7 @@ Defines content model category macros referenced via `:model()`. Structure:
383
391
  | `#palpable` | Elements that render visible content |
384
392
  | `#script-supporting` | Script-supporting elements (script, template) |
385
393
 
386
- **SVG categories (19):**
394
+ **SVG categories (18):**
387
395
 
388
396
  | Category | Description |
389
397
  | -------------------------- | ----------------------------------------------------------------- |
@@ -406,6 +414,14 @@ Defines content model category macros referenced via `:model()`. Structure:
406
414
  | `#SVGTextContent` | Text content elements (text, textPath, tspan, etc.) |
407
415
  | `#SVGTextContentChild` | Text content child elements (textPath, tspan, etc.) |
408
416
 
417
+ **MathML categories (3):**
418
+
419
+ | Category | Description |
420
+ | --------------------- | ------------------------------------------------------------- |
421
+ | `#MathMLPresentation` | MathML presentation elements (mi, mn, mo, mfrac, msqrt, etc.) |
422
+ | `#MathMLScript` | MathML script elements (msub, msup, msubsup, munder, mover) |
423
+ | `#MathMLTabular` | MathML tabular elements (mtable, mtr, mtd) |
424
+
409
425
  ## Full Examples
410
426
 
411
427
  ### Simple HTML Element -- `<p>`
@@ -519,3 +535,25 @@ Defines content model category macros referenced via `:model()`. Structure:
519
535
  }
520
536
  }
521
537
  ```
538
+
539
+ ### MathML Element -- `mml:mfrac`
540
+
541
+ ```json
542
+ // https://w3c.github.io/mathml-core/#fractions-mfrac
543
+ {
544
+ "contentModel": {
545
+ "contents": [{ "oneOrMore": ":model(MathMLPresentation)", "max": 2 }]
546
+ },
547
+ "globalAttrs": {
548
+ "#HTMLGlobalAttrs": true,
549
+ "#GlobalEventAttrs": true,
550
+ "#ARIAAttrs": true,
551
+ "#MathMLGlobalAttrs": true
552
+ },
553
+ "attributes": {},
554
+ "aria": {
555
+ "implicitRole": false,
556
+ "permittedRoles": { "mathml-aam": true }
557
+ }
558
+ }
559
+ ```