diff --git a/packages/svelte/scripts/process-messages/index.js b/packages/svelte/scripts/process-messages/index.js index 1904f1dfb4..4d60bdcb18 100644 --- a/packages/svelte/scripts/process-messages/index.js +++ b/packages/svelte/scripts/process-messages/index.js @@ -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`, '\n\n' + Object.entries(messages[category]) .map(([code, { messages, details }]) => { const chunks = [ - `### ${code}`, + `${heading_notation} ${code}`, ...messages.map((message) => '```\n' + message + '\n```') ];