Skip to content

Commit 08754b5

Browse files
committed
Update Render Node and Index spec for @PageImage
1 parent c54fbd4 commit 08754b5

File tree

2 files changed

+91
-1
lines changed

2 files changed

+91
-1
lines changed

Sources/SwiftDocC/SwiftDocC.docc/Resources/RenderIndex.spec.json

Lines changed: 64 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,13 @@
2626
"$ref": "#/components/schemas/Node"
2727
}
2828
}
29-
}
29+
},
30+
"references": {
31+
"type": "object",
32+
"additionalProperties": {
33+
"$ref": "#/components/schemas/ImageRenderReference"
34+
}
35+
},
3036
}
3137
},
3238
"Node": {
@@ -94,6 +100,10 @@
94100
"type": "boolean",
95101
"default": "false"
96102
},
103+
"icon": {
104+
"type": "string",
105+
"format": "reference(ImageRenderReference)"
106+
},
97107
"children": {
98108
"type": "array",
99109
"items": {
@@ -120,6 +130,59 @@
120130
"type": "integer"
121131
}
122132
}
133+
},
134+
"ImageRenderReference": {
135+
"type": "object",
136+
"required": [
137+
"type",
138+
"identifier",
139+
"variants"
140+
],
141+
"properties": {
142+
"type": {
143+
"type": "string",
144+
"enum": ["image"]
145+
},
146+
"alt": {
147+
"type": "string",
148+
"nullable": true
149+
},
150+
"identifier": {
151+
"type": "string"
152+
},
153+
"variants": {
154+
"type": "array",
155+
"items": {
156+
"$ref": "#/components/schemas/RenderReferenceVariant"
157+
}
158+
}
159+
}
160+
},
161+
"RenderReferenceVariant": {
162+
"type": "object",
163+
"required": [
164+
"url",
165+
"traits"
166+
],
167+
"properties": {
168+
"url": {
169+
"type": "string"
170+
},
171+
"svgID": {
172+
"type": "string",
173+
"description": "The ID attribute for the image that should be rendered in the SVG file represented by this variant."
174+
},
175+
"traits": {
176+
"type": "array",
177+
"items": {
178+
"$ref": "#/components/schemas/RenderReferenceVariantTrait"
179+
}
180+
}
181+
}
182+
},
183+
"RenderReferenceVariantTrait": {
184+
"type": "string",
185+
"enum": ["1x", "2x", "3x", "light", "dark"]
123186
}
124187
},
125188
"requestBodies": {},

Sources/SwiftDocC/SwiftDocC.docc/Resources/RenderNode.spec.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1320,6 +1320,10 @@
13201320
"url": {
13211321
"type": "string"
13221322
},
1323+
"svgID": {
1324+
"type": "string",
1325+
"description": "The ID attribute for the image that should be rendered in the SVG file represented by this variant."
1326+
},
13231327
"traits": {
13241328
"type": "array",
13251329
"items": {
@@ -1521,6 +1525,12 @@
15211525
"$ref": "#/components/schemas/DeclarationToken"
15221526
}
15231527
},
1528+
"images": {
1529+
"type": "array",
1530+
"items": {
1531+
"$ref": "#/components/schemas/TopicImage"
1532+
}
1533+
},
15241534
"navigatorTitle": {
15251535
"type": "array",
15261536
"items": {
@@ -1562,6 +1572,23 @@
15621572
}
15631573
}
15641574
},
1575+
"TopicImage": {
1576+
"type": "object",
1577+
"required": [
1578+
"type",
1579+
"identifier"
1580+
],
1581+
"properties": {
1582+
"type": {
1583+
"type": "string",
1584+
"enum": ["icon", "card"]
1585+
},
1586+
"reference": {
1587+
"type": "string",
1588+
"format": "reference(ImageRenderReference)"
1589+
}
1590+
}
1591+
},
15651592
"SymbolTag": {
15661593
"type": "object",
15671594
"required": [

0 commit comments

Comments
 (0)