|
|
|
|
@ -71,13 +71,17 @@ function run() {
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// compile errors and warnings don't have sub-categories so they must use the
|
|
|
|
|
// h2 notation to correctly display in the 'On this page' list of the docs site
|
|
|
|
|
const heading_notation = category.startsWith('compile-') ? '##' : '###';
|
|
|
|
|
|
|
|
|
|
fs.writeFileSync(
|
|
|
|
|
`${DIR}/${category}.md`,
|
|
|
|
|
'<!-- This file is generated by scripts/process-messages/index.js. Do not edit! -->\n\n' +
|
|
|
|
|
Object.entries(messages[category])
|
|
|
|
|
.map(([code, { messages, details }]) => {
|
|
|
|
|
const chunks = [
|
|
|
|
|
`### ${code}`,
|
|
|
|
|
`${heading_notation} ${code}`,
|
|
|
|
|
...messages.map((message) => '```\n' + message + '\n```')
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|