code: func GenYamlTreeCustom(cmd *cobra.Command, dir string, filePrepender func(string) string) error {
  	for _, c := range cmd.Commands() {
  		if !c.IsAvailableCommand() || c.IsAdditionalHelpTopicCommand() {
  			continue
  		}
  		if err := GenYamlTreeCustom(c, dir, filePrepender); err != nil {
  			return err
  		}
  	}
  
  	basename := strings.Replace(cmd.CommandPath(), " ", "_", -1) + ".yaml"
  	filename := filepath.Join(dir, basename)
  	f, err := os.Create(filename)
  	if err != nil {
  		return err
  	}
  	defer f.Close()
  
  	if _, err := io.WriteString(f, filePrepender(filename)); err != nil {
  		return err
  	}
  	return GenYamlCustom(cmd, f)
  }
docs: // GenYamlTreeCustom creates yaml structured ref files