Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: auto generate sidebar #130

Merged
merged 4 commits into from
Jan 22, 2021
Merged

feat: auto generate sidebar #130

merged 4 commits into from
Jan 22, 2021

Conversation

sy-records
Copy link
Member

@sy-records sy-records commented Jan 15, 2021

I have tested it under mac, can anyone test it in other environments?

feat: docsifyjs/docsify#1290

fix: docsifyjs/docsify#1323
fix: docsifyjs/docsify#1444

@sy-records sy-records requested review from jamesgeorge007, anikethsaha and a team January 15, 2021 08:07
Copy link
Member

@jamesgeorge007 jamesgeorge007 left a comment

Choose a reason for hiding this comment

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

Let's rename it to generate. Can you write tests?

Copy link
Member

@Koooooo-7 Koooooo-7 left a comment

Choose a reason for hiding this comment

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

Image_20210116
LGTM.

@Koooooo-7
Copy link
Member

FYI, I run the npm run test .\e2e\cli.test.js , it seems failed due to the i18n stuff. is there something wrong ?

Copy link
Member

@jamesgeorge007 jamesgeorge007 left a comment

Choose a reason for hiding this comment

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

Looking good, left a couple of suggestions.

README.md Outdated Show resolved Hide resolved

if (!exists(sidebarPath)) {
genSidebar(cwdPath, sidebarPath)
console.log(chalk.green(`Generate sidebar file '${sidebar}' success.`))
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
console.log(chalk.green(`Generate sidebar file '${sidebar}' success.`))
console.log(chalk.green(`Successfully generated the sidebar file '${sidebar}'.`))

Copy link
Member

Choose a reason for hiding this comment

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

It is better to have a logger utility. There are a couple of places that require an update; feel free to address it in a future PR.

- console.error(chalk.red(msg))
+ logger.error(msg)
// logger.js
const error = (msg) => console.error(chalk.red(msg)); 

Copy link
Member Author

Choose a reason for hiding this comment

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

After the merge, I will submit a PR to amend this

lib/commands/generate.js Outdated Show resolved Hide resolved
lib/commands/generate.js Outdated Show resolved Hide resolved
lib/commands/generate.js Outdated Show resolved Hide resolved
e2e/commands/generate.test.js Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Proposal: Allow :include in sidebar Does not automatically generate a left-hand directory
4 participants