Skip to content

Commit

Permalink
display templateParts info in a table
Browse files Browse the repository at this point in the history
  • Loading branch information
carolinan authored and aristath committed Mar 1, 2023
1 parent 4247c51 commit 1fed2df
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
8 changes: 4 additions & 4 deletions bin/api-docs/gen-theme-reference.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1fed2df

Please sign in to comment.