returns a pretty-printed string describing a
    :class:`dossier.fc.FeatureCollection`.

    @features_to_show: list of features to include, defaults to None
    meaning include all.

    @lexigraphic: passed to repr_feature

    @display_only: if DISPLAY_PREFIX versions of features are present, only show those. (default True)

def detailed_view(fc, features_to_show=None, max_keys=100, lexigraphic=False,
                  display_only=True):
    '''
    returns a pretty-printed string describing a
    :class:`dossier.fc.FeatureCollection`.

    @features_to_show: list of features to include, defaults to None
    meaning include all.

    @lexigraphic: passed to repr_feature

    @display_only: if DISPLAY_PREFIX versions of features are present, only show those. (default True)
    '''
    if '#NAME' in fc:
        top_lines = ['NAME: %s' % key_sorted_dict_str( fc.get('#NAME') )]
    elif '#NOM' in fc:
        top_lines = ['NOM: %s' % key_sorted_dict_str( fc.get('#NOM') )]
    elif 'NAME' in fc:
        top_lines = ['NAME: %s' % key_sorted_dict_str( fc.get('NAME') )]
    elif 'NOM' in fc:
        top_lines = ['NOM: %s' % key_sorted_dict_str( fc.get('NOM') )]
    else:
        top_lines = ['no-NAME, no-NOM']
    bottom_lines = []
    feature_names = fc.keys()
    display_only = _check_display_only(display_only, feature_names)
    feature_names.sort()
    hidden_count = 0
    for key in feature_names:
        if display_only and (not key.startswith(FeatureCollection.DISPLAY_PREFIX)):
            hidden_count += 1
            continue
        if key in fc and fc[key]:
            if features_to_show and key not in features_to_show:
                continue
            repr = repr_feature(fc[key], max_keys=max_keys, lexigraphic=lexigraphic)
            if '\n' in repr:
                ## save these for the end
                # use four spaces, smaller than indent=8 above
                bottom_lines.append( '    %s: %s' % (key, repr) )
            else:
                top_lines.append( '    %s: %s' % (key, repr))
    if hidden_count:
        bottom_lines.append('    (and %s hidden features)' % (hidden_count,))
    return '\n'.join(top_lines + bottom_lines)