Skip to content

Commit 7e2c7e0

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 3099317 commit 7e2c7e0

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
@@ -839,11 +839,29 @@
839839
}
840840
}
841841
},
842+
"extendedData": {
843+
"type": "object",
844+
"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.",
845+
"additionalProperties": {
846+
"$ref": "#/components/schemas/TableExtendedData"
847+
}
848+
},
842849
"metadata": {
843850
"$ref": "#/components/schemas/RenderContentMetadata"
844851
}
845852
}
846853
},
854+
"TableExtendedData": {
855+
"type": "object",
856+
"properties": {
857+
"colspan": {
858+
"type": "integer"
859+
},
860+
"rowspan": {
861+
"type": "integer"
862+
}
863+
}
864+
},
847865
"Step": {
848866
"required": [
849867
"type",

0 commit comments

Comments
 (0)