'Generate reST for member documentation.
If *all_members* is True, do all members, else those given by
*self.options.members*.'

def document_members(self, all_members=False):

    self.env.temp_data['autodoc:module'] = self.modname
    if self.objpath:
        self.env.temp_data['autodoc:class'] = self.objpath[0]
    want_all = (all_members or self.options.inherited_members or (self.options.members is ALL))
    (members_check_module, members) = self.get_object_members(want_all)
    if self.options.exclude_members:
        members = [(membername, member) for (membername, member) in members if (membername not in self.options.exclude_members)]
    memberdocumenters = []
    for (mname, member, isattr) in self.filter_members(members, want_all):
        classes = [cls for cls in itervalues(AutoDirective._registry) if cls.can_document_member(member, mname, isattr, self)]
        if (not classes):
            continue
        classes.sort(key=(lambda cls: cls.priority))
        full_mname = ((self.modname + '::') + '.'.join((self.objpath + [mname])))
        documenter = classes[(-1)](self.directive, full_mname, self.indent)
        memberdocumenters.append((documenter, isattr))
    member_order = (self.options.member_order or self.env.config.autodoc_member_order)
    if (member_order == 'groupwise'):
        memberdocumenters.sort(key=(lambda e: e[0].member_order))
    elif ((member_order == 'bysource') and self.analyzer):
        tagorder = self.analyzer.tagorder
        def keyfunc(entry):
            fullname = entry[0].name.split('::')[1]
            return tagorder.get(fullname, len(tagorder))
        memberdocumenters.sort(key=keyfunc)
    for (documenter, isattr) in memberdocumenters:
        documenter.generate(all_members=True, real_modname=self.real_modname, check_module=(members_check_module and (not isattr)))
    self.env.temp_data['autodoc:module'] = None
    self.env.temp_data['autodoc:class'] = None
