Return doc for a class.

def get_class_doc(klass, config=default_config):
    """Return doc for a class."""
    if config.exclude_class:
        for ex in config.exclude_class:
            if ex.match(klass.__name__):
                return None

    nested_doc = []
    class_dict = klass.__dict__

    for item in dir(klass):
        if item in class_dict.keys():
            appended = None
            if isinstance(class_dict[item], type) and config.nested_class:
                appended = get_class_doc(class_dict[item], config)
            elif isinstance(class_dict[item], types.FunctionType):
                appended = get_function_doc(class_dict[item], config)
            if appended is not None:
                nested_doc.append(appended)

    return _doc_object(klass, 'class', nested_doc, config)