| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
Is this project still maintained? |
Sorry, something went wrong.
There was a problem hiding this comment.
Adds recursive sidebar generation to support multi-level directory structures (Issue #179), with directory entries optionally linking to a folder README when present (aligned with docsifyjs/docsify#1290).
Changes:
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Sorry, something went wrong.
| } else if (!hasChildContent && isReadmePresent) { | ||
| content.push(`- [${filename}](${filePath}/README.md)`) | ||
| } else { | ||
| content.push(`- [${filename}](${filePath})`) |
| const isReadmePresent = fs.existsSync(path.join(cwdPath, 'README.md')) | ||
| const hasChildContent = childContent.length > 0 | ||
|
|
||
| if (hasChildContent && isReadmePresent) { | ||
| content.push(`- [${filename}](${filePath}/README.md)`, ...childContent.map(item => ` ${item}`)) | ||
| } else if (hasChildContent && !isReadmePresent) { | ||
| content.push(`- ${filename}`, ...childContent.map(item => ` ${item}`)) | ||
| } else if (!hasChildContent && isReadmePresent) { | ||
| content.push(`- [${filename}](${filePath}/README.md)`) |
| const filename = file.split('-') | ||
| const fileWithExtension = filename.length > 1 ? filename[1] : filename[0] | ||
| return path.basename(fileWithExtension, '.md') |
| } else { | ||
| content.push(`- [${filename}](${filePath})`) |
| fs.writeFileSync(sidebarPath, sidebarContent, 'utf8', err => { | ||
| if (err) { | ||
| logger.error(`Couldn't generate the sidebar file, error: ${err.message}`) | ||
| } | ||
| }) |
| fs.readdirSync(directory).forEach(file => { | ||
| const cwdPath = path.join(directory, file) | ||
| const relativePath = path.relative(rootPath, cwdPath) | ||
| const filePath = relativePath.replace(/\s/g, '%20') |
| Back | FazBrowse Home | New Git URL |
fixes #179
Reference docsifyjs/docsify#1290
I will do another PR for documentation if this one helps :)