| 82 | } |
| 83 | |
| 84 | async function markdownFiles(root, relativeDirectory) { |
| 85 | const entries = await readdir(path.join(root, relativeDirectory), { withFileTypes: true }); |
| 86 | const files = []; |
| 87 | for (const entry of entries) { |
| 88 | const relativePath = path.posix.join(relativeDirectory, entry.name); |
| 89 | if (entry.isDirectory()) files.push(...(await markdownFiles(root, relativePath))); |
| 90 | else if (entry.name.endsWith('.md')) files.push(relativePath); |
| 91 | } |
| 92 | return files.sort(); |
| 93 | } |
| 94 | |
| 95 | async function allPaths(root) { |
| 96 | const paths = []; |