Skip to content

Commit 0253ded

Browse files
add an extendedData field to tables
`extendedData` provides supplementary per-cell data for tables. It's indexed with a generated string key with the format 'X_Y', as described in its "description" field. For the most part this can be omitted, but here it introduces the 'colspan' and 'rowspan' properties, with the following semantics: - the default value of each of these is 1. the property will be absent in this case. - if all values in an `extendedData` object are the default, it will not be included in the Render JSON. - a value greater than one has the same semantic meaning as the attributes of the same name on the HTML `tr`/`th` elements - that this cell should fill in the space of more than one column and/or row. - a value of zero means that the cell should not be rendered in HTML because another cell has a span that overwrites it.
1 parent 113ffa3 commit 0253ded

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -861,11 +861,29 @@
861861
}
862862
}
863863
},
864+
"extendedData": {
865+
"type": "object",
866+
"description": "Additional data that can be applied per-cell. Property keys have the pattern 'X_Y', where X is the numerical row index and Y is the numerical column index, both starting from zero.",
867+
"additionalProperties": {
868+
"$ref": "#/components/schemas/TableExtendedData"
869+
}
870+
},
864871
"metadata": {
865872
"$ref": "#/components/schemas/RenderContentMetadata"
866873
}
867874
}
868875
},
876+
"TableExtendedData": {
877+
"type": "object",
878+
"properties": {
879+
"colspan": {
880+
"type": "integer"
881+
},
882+
"rowspan": {
883+
"type": "integer"
884+
}
885+
}
886+
},
869887
"Step": {
870888
"required": [
871889
"type",

0 commit comments

Comments
 (0)