GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(generate): auto generate nested sidebar #179 by theMyth333 · Pull Request #209 · docsifyjs/docsify-cli

Conversation

@theMyth333

@theMyth333 theMyth333 commented Dec 29, 2023

Copy link
Copy Markdown

fixes #179
Reference docsifyjs/docsify#1290

I will do another PR for documentation if this one helps :)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@theMyth333
feat(generate): auto generate nested sidebar docsifyjs#179
beaf72b
@angelodias-appno

angelodias-appno commented Jan 14, 2025

Copy link
Copy Markdown

Is this project still maintained?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sy-records
sy-records requested a review from Copilot March 13, 2026 08:43
Copilot started reviewing on behalf of sy-records March 13, 2026 08:43
View session
Copilot AI reviewed Mar 13, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

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:

  • Replaces the flat file-walk sidebar generator with a recursive generateContent() implementation.
  • Adds README-aware directory entries and indentation for nested content.
  • Introduces modifyFileName() for displayed sidebar labels.

💡 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.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread lib/commands/generate.js
} else if (!hasChildContent && isReadmePresent) {
content.push(`- [${filename}](${filePath}/README.md)`)
} else {
content.push(`- [${filename}](${filePath})`)
Comment thread lib/commands/generate.js
Comment on lines +52 to +60
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)`)
Comment thread lib/commands/generate.js
Comment on lines +74 to +76
const filename = file.split('-')
const fileWithExtension = filename.length > 1 ? filename[1] : filename[0]
return path.basename(fileWithExtension, '.md')
Comment thread lib/commands/generate.js
Comment on lines +61 to +62
} else {
content.push(`- [${filename}](${filePath})`)
Comment thread lib/commands/generate.js
Comment on lines +34 to 38
fs.writeFileSync(sidebarPath, sidebarContent, 'utf8', err => {
if (err) {
logger.error(`Couldn't generate the sidebar file, error: ${err.message}`)
}
})
Comment thread lib/commands/generate.js
fs.readdirSync(directory).forEach(file => {
const cwdPath = path.join(directory, file)
const relativePath = path.relative(rootPath, cwdPath)
const filePath = relativePath.replace(/\s/g, '%20')

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

I would like to know why generating multi-level directories is not supported

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@theMyth333 @angelodias-appno
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.