-
-
Notifications
You must be signed in to change notification settings - Fork 154
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
Conversation
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.
Let's rename it to generate
. Can you write tests?
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.
FYI, I run the |
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.
Looking good, left a couple of suggestions.
lib/commands/generate.js
Outdated
|
||
if (!exists(sidebarPath)) { | ||
genSidebar(cwdPath, sidebarPath) | ||
console.log(chalk.green(`Generate sidebar file '${sidebar}' success.`)) |
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.
console.log(chalk.green(`Generate sidebar file '${sidebar}' success.`)) | |
console.log(chalk.green(`Successfully generated the sidebar file '${sidebar}'.`)) |
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.
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));
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.
After the merge, I will submit a PR to amend this
Co-authored-by: James George <[email protected]>
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