Skip to content

Commit

Permalink
prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
mbostock committed Jul 29, 2023
1 parent 9dcaefb commit 13b5223
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions docs/components/links.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ export async function readMarkdownSource(f) {
// Recursively find all md files in the directory.
export async function* readMarkdownFiles(root, subpath = "/") {
for (const fname of await readdir(root + subpath)) {
if (!fname.includes(".") && (await stat(root + subpath + fname)).isDirectory()) yield* readMarkdownFiles(root, subpath + fname + "/");
else if (fname.endsWith(".md")) yield subpath + fname;
if (!fname.includes(".") && (await stat(root + subpath + fname)).isDirectory()) {
yield* readMarkdownFiles(root, subpath + fname + "/");
} else if (fname.endsWith(".md")) {
yield subpath + fname;
}
}
}

0 comments on commit 13b5223

Please sign in to comment.