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

Fold documentation-readme into main cli? #261

Closed
anandthakker opened this issue Nov 27, 2015 · 9 comments
Closed

Fold documentation-readme into main cli? #261

anandthakker opened this issue Nov 27, 2015 · 9 comments

Comments

@anandthakker
Copy link
Contributor

Going along with the work in #236, should documentation-readme become documentation readme? @tmcw

@tmcw
Copy link
Member

tmcw commented Nov 30, 2015

Yep, I think this makes sense.

@jfirebaugh
Copy link
Member

Agreed about documentation readme being the ideal CLI syntax. Is there some way we can support command plugins, so that not all possible CLI functionality has to be baked in?

@anandthakker
Copy link
Contributor Author

@jfirebaugh I like that notion.

As an initial take on the approach: maybe each command plugin is just a module that exports (a) a function accepting a reference to the main documentation module and some options, and (b) a short description. Then it's pretty straightforward for the main documentation cli can fairly easily display it as an option in the top-level help, and delegate to it with its (parsed) subargs.

"Core" commands, like build, can be baked in as local (internal) modules; others, like readme, can be a separate npm package pulled in as a dependency.

@jfirebaugh
Copy link
Member

That sounds good. The open question in my mind is how registration of command plugins would work. Will documentation have a dependency on every command plugin? That doesn't seem scalable. If not, how does it obtain the list of currently installed plugins? Given any particular command documentation foo it could try requiring documentation-foo, but how would it know to display foo as an option in the top-level help when no subcommand is provided?

@anandthakker
Copy link
Contributor Author

Yeah, I was stumped on the registration issue too. My instinct is that the
"right" approach to registration depends a lot on the nature of the plugin
ecosystem: if it start to become super diverse and dynamic, then it will
become worth it to invest in the discovery problem. Until then, I think we
can get by with (a) a few commands that ship as dependencies (like
documentation-readme), and (b) a hardcoded list of "known" installable
plugins which we can attempt to require.

On Fri, Dec 4, 2015 at 11:26 AM John Firebaugh notifications@github.com
wrote:

That sounds good. The open question in my mind is how registration of
command plugins would work. Will documentation have a dependency on every
command plugin? That doesn't seem scalable. If not, how does it obtain the
list of currently installed plugins? Given any particular command documentation
foo it could try requiring documentation-foo, but how would it know to
display foo as an option in the top-level help when no subcommand is
provided?


Reply to this email directly or view it on GitHub
#261 (comment)
.

@tmcw
Copy link
Member

tmcw commented Dec 4, 2015

I'm kind of ¯_(ツ)_/¯ on installable cli plugins, given the low'ish number of plugins off the bat and the weirdness of implementing this with requires, it seems like we should get it done first and refactor later if we have ideas for what the next 5 plugins should be.

@anandthakker
Copy link
Contributor Author

Yeah, agreed -- meant installable plugins bit just as a plausible future
bridge we can cross when we come to it

On Fri, Dec 4, 2015 at 2:55 PM Tom MacWright notifications@github.com
wrote:

I'm kind of ¯_(ツ)_/¯ on installable cli plugins, given the low'ish number
of plugins off the bat and the weirdness of implementing this with
requires, it seems like we should get it done first and refactor later if
we have ideas for what the next 5 plugins should be.


Reply to this email directly or view it on GitHub
#261 (comment)
.

@jfirebaugh
Copy link
Member

👍

@anandthakker
Copy link
Contributor Author

@tmcw do you see any reason to keep documentation-readme in its own repo or npm package? My inclination would be to fold the code in here as well -- #277 means we could keep it separate, but I don't really see a good reason to...

@tmcw tmcw closed this as completed in #313 Dec 14, 2015
rhendric pushed a commit to rhendric/documentation that referenced this issue Sep 15, 2022
* record update function

* no monads
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

No branches or pull requests

3 participants