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

support docsify init --plugins #99

Merged
merged 32 commits into from
Jun 11, 2021
Merged

support docsify init --plugins #99

merged 32 commits into from
Jun 11, 2021

Conversation

tool3
Copy link
Contributor

@tool3 tool3 commented Mar 12, 2020

having a go at #98 .

command: init
option: --plugins, -p

plugins are now supported via the following usage:
docsify init docs/ -p search gitalk <some_other_plugin>

note that by default a plugin will be added as a script tag with a url pointing to https://unpkg.com/docsify/lib/plugins/<plugin_name> otherwise it will use the url provided as an argument.

example and documentation was added to docs/README

Copy link
Member

@anikethsaha anikethsaha left a comment

Choose a reason for hiding this comment

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

It looks like you removed the main readme ! please revert it .
there are unncessary files like .nojekyll , index.html etc in root. Please check.
please add tests as well

@tool3
Copy link
Contributor Author

tool3 commented Mar 13, 2020

sorry about that! have no idea where those came from 👀

by tests do you mean adding a test to the ava snapshot e2e ?

Thanks !

@tool3
Copy link
Contributor Author

tool3 commented Mar 13, 2020

okay so I added tests but in order to do that I had to change the test structure a bit to accept command help.

let me know what you think 🤘🏼

README.md Outdated Show resolved Hide resolved
@anikethsaha
Copy link
Member

Thanks ! I will review it soon

@anikethsaha anikethsaha self-requested a review March 13, 2020 09:19
@anikethsaha anikethsaha self-assigned this Mar 13, 2020
Copy link
Member

@anikethsaha anikethsaha left a comment

Choose a reason for hiding this comment

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

Apologizes for the delay. Completely lost track of this.

lib/commands/init.js Outdated Show resolved Hide resolved
@jhildenbiddle jhildenbiddle linked an issue Jun 18, 2020 that may be closed by this pull request
@tool3 tool3 requested a review from anikethsaha June 22, 2020 11:29
@noraj
Copy link

noraj commented Apr 28, 2021

@anikethsaha is that possible to re-review?

replace(target(filename), '_plugins_', '_plugin\n '.repeat(plugins.length))
plugins.forEach(plugin => {
const major = version[0]
const url = plugin.includes('//') ? plugin : `https://cdn.jsdelivr.net/npm/docsify@${major}/lib/plugins/${plugin}.min.js`
Copy link
Member

Choose a reason for hiding this comment

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

if use ./bin/docsify init docs2 -p 1, An exception will be thrown here

image

Copy link
Member

Choose a reason for hiding this comment

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

I added the enquirer in #117, you can use this here as well.

see https://github.com/enquirer/enquirer#multiselect-prompt

Copy link
Member

@jamesgeorge007 jamesgeorge007 May 27, 2021

Choose a reason for hiding this comment

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

Ideally, we should support specifying a list of plugins as an argument to --plugins such that the prompt shows up on not supplying any or passing in an unsupported plugin.

docsify init [path] --plugins, -p [...plugins]

lib/commands/init.js Outdated Show resolved Hide resolved
lib/template/index.html Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
docs/README.md Outdated Show resolved Hide resolved
@sy-records
Copy link
Member

resolve #99 (comment) .

When executing the init command, the user may not know which plugins he wants to use and the corresponding plugin names

image

@sy-records sy-records requested a review from a team May 25, 2021 10:39
@jamesgeorge007
Copy link
Member

resolve #99 (comment) .

When executing the init command, the user may not know which plugins he wants to use and the corresponding plugin names

image

The success message should come after the prompt.

@sy-records
Copy link
Member

The success message should come after the prompt.

done.

@sy-records
Copy link
Member

@jamesgeorge007 Thank you for the modifications 790e96c

But there seems to be some problems:

  1. use ctrl+c , will output the help message

image

  1. use ctrl+c, The docs-test directory is created, but the tip message is missing
Initialization succeeded! Please run docsify serve docs-test/

image

@jamesgeorge007 jamesgeorge007 removed their request for review May 28, 2021 06:10
@jamesgeorge007
Copy link
Member

Good catch. I've pushed a fix

@sy-records sy-records merged commit 8bb295c into docsifyjs:master Jun 11, 2021
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.

support plugins with docsify init
6 participants