'Make autodoc documentation template string for a module
Parameters
uri : string
python location of module - e.g \'sphinx.builder\'
Returns
S : string
Contents of API doc'

def generate_api_doc(self, uri):

    (functions, classes) = self.find_funcs_classes(uri)
    if ((not len(functions)) and (not len(classes))):
        return ''
    uri_short = re.sub(('^%s\\.' % self.package_name), '', uri)
    ad = '..    AUTO-GENERATED    FILE    --    DO    NOT    EDIT!\n\n'
    if ('.' in uri):
        chap_title = (('Module:    :mod:`' + uri_short) + '`')
    else:
        chap_title = ((':mod:`' + uri_short) + '`')
    ad += ((chap_title + '\n') + (self.rst_section_levels[1] * len(chap_title)))
    ad += (('\n..    automodule::    ' + uri) + '\n')
    ad += (('\n..    currentmodule::    ' + uri) + '\n')
    if classes:
        subhead = (str(len(classes)) + ('    Classes' if (len(classes) > 1) else '    Class'))
        ad += (((('\n' + subhead) + '\n') + (self.rst_section_levels[2] * len(subhead))) + '\n')
    for c in classes:
        ad += (('\n..    autoclass::    ' + c.name) + '\n')
        ad += '        :members:\n        :show-inheritance:\n'
        if c.has_init:
            ad += '\n        ..    automethod::    __init__\n'
    if functions:
        subhead = (str(len(functions)) + ('    Functions' if (len(functions) > 1) else '    Function'))
        ad += (((('\n' + subhead) + '\n') + (self.rst_section_levels[2] * len(subhead))) + '\n')
    for f in functions:
        ad += (((('\n..    autofunction::    ' + uri) + '.') + f) + '\n\n')
    return ad
