fix compiler docs titles

fix-compiler-docs
Tee Ming 1 day ago
parent fcdc0289db
commit b2ee080bc5

@ -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```')
];

Loading…
Cancel
Save