code: func ToPages(seq interface{}) (Pages, error) {
  	if seq == nil {
  		return Pages{}, nil
  	}
  
  	switch v := seq.(type) {
  	case Pages:
  		return v, nil
  	case *Pages:
  		return *(v), nil
  	case WeightedPages:
  		return v.Pages(), nil
  	case PageGroup:
  		return v.Pages, nil
  	case []interface{}:
  		pages := make(Pages, len(v))
  		success := true
  		for i, vv := range v {
  			p, ok := vv.(Page)
  			if !ok {
  				success = false
  				break
  			}
  			pages[i] = p
  		}
  		if success {
  			return pages, nil
  		}
  	}
  
  	return nil, fmt.Errorf("cannot convert type %T to Pages", seq)
  }
docs: // ToPages tries to convert seq into Pages.