Skip to content

Commit 021c9c0

Browse files
committed
fix: improve schema documentation generation and logging
- Added logging for uncategorized schemas in the generate-schema-docs script to enhance visibility during documentation generation. - Refined sorting methods for core and advanced schemas to use locale comparison for better accuracy. - Updated the addFrontMatterToSchemaFiles function to improve readability by using `const` for content variable and clarifying the continue statement.
1 parent 3e86cbf commit 021c9c0

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

scripts/generate-schema-docs.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,11 +178,15 @@ export function createIndexFile(schemaFiles) {
178178
core.push(link)
179179
} else if (advancedSchemas.includes(baseName)) {
180180
advanced.push(link)
181+
} else {
182+
console.log(
183+
`Note: Schema '${baseName}' is not categorised as core or advanced`
184+
)
181185
}
182186
})
183187

184-
core.sort()
185-
advanced.sort()
188+
core.sort((a, b) => a.localeCompare(b))
189+
advanced.sort((a, b) => a.localeCompare(b))
186190

187191
const content = `---
188192
layout: default
@@ -556,10 +560,12 @@ export function addFrontMatterToSchemaFiles() {
556560

557561
for (const file of mdFiles) {
558562
const filePath = path.join(docsOutputDir, file)
559-
let content = fs.readFileSync(filePath, 'utf8')
563+
const content = fs.readFileSync(filePath, 'utf8')
560564

561565
// Skip if already has front matter
562-
if (content.startsWith('---')) continue
566+
if (content.startsWith('---')) {
567+
continue
568+
}
563569

564570
// Generate title from filename
565571
const title = file

0 commit comments

Comments
 (0)