From 1fed2dfa9450a1d611cab0cb05ea346f9c95ee42 Mon Sep 17 00:00:00 2001 From: Carolina Nymark Date: Tue, 21 Feb 2023 11:33:57 +0100 Subject: [PATCH] display templateParts info in a table --- bin/api-docs/gen-theme-reference.js | 8 ++++---- .../theme-json-reference/theme-json-living.md | 9 ++++++--- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/bin/api-docs/gen-theme-reference.js b/bin/api-docs/gen-theme-reference.js index f9d8d35cd373b9..6ebf358876764f 100644 --- a/bin/api-docs/gen-theme-reference.js +++ b/bin/api-docs/gen-theme-reference.js @@ -227,12 +227,12 @@ autogen += '\n\n'; // templateParts const templateParts = themejson.properties.templateParts.items.properties; autogen += '## templateParts' + '\n\n'; -autogen += themejson.properties.templateParts.description + '\n'; +autogen += themejson.properties.templateParts.description + '\n\n'; autogen += 'Type: `' + themejson.properties.templateParts.items.type + '`.\n\n'; +autogen += '| Property | Description | Type |\n'; +autogen += '| --- | --- | --- |\n'; keys( templateParts ).forEach( ( key ) => { - autogen += '`' + key + '`: '; - autogen += templateParts[ key ].description + ' '; - autogen += 'Type: `' + templateParts[ key ].type + '`.\n'; + autogen += `| ${ key } | ${ templateParts[ key ].description } | ${ templateParts[ key ].type } |\n`; } ); autogen += '\n\n'; diff --git a/docs/reference-guides/theme-json-reference/theme-json-living.md b/docs/reference-guides/theme-json-reference/theme-json-living.md index cf40c9d83c1846..f3b0ea636d0912 100644 --- a/docs/reference-guides/theme-json-reference/theme-json-living.md +++ b/docs/reference-guides/theme-json-reference/theme-json-living.md @@ -261,11 +261,14 @@ Type: `object`. ## templateParts Additional metadata for template parts defined in the parts folder. + Type: `object`. -`name`: Filename, without extension, of the template in the parts folder. Type: `string`. -`title`: Title of the template, translatable. Type: `string`. -`area`: The area the template part is used for. Block variations for `header` and `footer` values exist and will be used when the area is set to one of those. Type: `string`. +| Property | Description | Type | +| --- | --- | --- | +| name | Filename, without extension, of the template in the parts folder. | string | +| title | Title of the template, translatable. | string | +| area | The area the template part is used for. Block variations for `header` and `footer` values exist and will be used when the area is set to one of those. | string | ## Patterns