Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions app/cli/documentation/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func main() {

var builder strings.Builder
for _, subCmd := range command.Commands() {
if !subCmd.Hidden {
if !subCmd.Hidden && !isPluginCommand(subCmd) {
// Start depth at 0 for subcommands
generateCommandDocs(subCmd, &builder, 0)
}
Expand All @@ -82,7 +82,7 @@ func generateCommandDocs(cmd *cobra.Command, builder *strings.Builder, currentDe

// Recursively process subcommands with increased depth
for _, subCmd := range cmd.Commands() {
if !subCmd.Hidden {
if !subCmd.Hidden && !isPluginCommand(subCmd) {
generateCommandDocs(subCmd, builder, currentDepth+1)
}
}
Expand Down Expand Up @@ -148,6 +148,11 @@ func isUnderlineHeader(line string) bool {
return regexp.MustCompile(`^[-=]+$`).MatchString(line)
}

// isPluginCommand checks if a command is from a plugin by looking for the plugin signature in the Long description
func isPluginCommand(cmd *cobra.Command) bool {
return strings.Contains(cmd.Long, "Provided by plugin:")
}

// processFinalDocument cleans up the final document by removing excessive newlines and headers.
func processFinalDocument(content string) string {
// Clean up excessive newlines and leftover headers
Expand Down
Loading