Repository navigation
plugins: include descriptions and websites in 'plugin available' list - #4228
gustavohnsv wants to merge 6 commits into
Conversation
Andriamanitra
left a comment
There was a problem hiding this comment.
I like the change but a more compact format would be nicer. Maybe we could put the name and website on the same line?
There is also -plugin search which has similar but differently formatted output, it would be nice to make both output formats match.
| separator := "" | ||
| fmt.Fprintln(out, "Available Plugins:") | ||
| for _, pkg := range packages { | ||
| fmt.Fprintln(out, pkg.Name) | ||
| fmt.Fprintf(out, separator) | ||
| separator = "\n\n" |
There was a problem hiding this comment.
I would get rid of the unnecessary mutable variable:
| separator := "" | |
| fmt.Fprintln(out, "Available Plugins:") | |
| for _, pkg := range packages { | |
| fmt.Fprintln(out, pkg.Name) | |
| fmt.Fprintf(out, separator) | |
| separator = "\n\n" | |
| fmt.Fprintln(out, "Available Plugins:") | |
| for i, pkg := range packages { | |
| if i > 0 { | |
| fmt.Fprintf(out, "\n\n") | |
| } |
There was a problem hiding this comment.
yeah, maybe use the loop variable is a better choice in this case
- add `printPluginList` helper to deduplicate output formatting - standardize display format between `plugin search` and `plugin available` - improve message when no plugins are found during search
bef41ef to
5b2b8da
Compare
|
@Andriamanitra can you check if this approach are what you thinking? ignore my forced push |
|
@gustavohnsv For sharing the output format between |
|
sure, i think this layout is pretty nice, i put everything in one line 😅 |
- add comment above function for more information
|
@Andriamanitra done? |
| fmt.Fprintf(out, "\n") | ||
| } | ||
| if p.Website == "" { | ||
| fmt.Fprintf(out, "%s - No website found.\n\t%s\n", p.Name, p.Description) |
There was a problem hiding this comment.
The "No website found." part feels unnecessary
There was a problem hiding this comment.
i put this because there are some plugins by default in micro without website reference, even if have a github page
micro plugin channel: https://github.com/micro-editor/plugin-channel/blob/master/channel.json
plugin without website reference example: https://raw.githubusercontent.com/micro-editor/updated-plugins/master/filemanager-plugin/repo.json
There was a problem hiding this comment.
I mean if it's not there just leave out the website part, no need for a placeholder value IMO. It's an optional field so it's normal to not have one. "No website found." makes it sound like there was some kind of error when looking for it.
There was a problem hiding this comment.
make sense, i wasn't think that way
Closes #4038
previously, running
plugin availableonly listed plugin names:this PR updates
plugin availableto display the plugin's name, description, and website URL (when provided inrepo.json):