def METHOD_NAME(self):
    """
    Create output folders and write .rst index files and doxyfile references
    The default template can be overloaded by using a custom template that
    matches the output filename (with the .j2 extension) in the template folder
    """
    env = Environment(loader=FileSystemLoader(str(self.template_path)))
    env.globals.update(len=len)
    for module in self.filesmap:
        # Create TOC file
        toc_out = self.output_path / f"{module}.rst"
        foldername = self.output_path / module
        basename = os.path.basename(module)
        innerdirs = []
        # Create list of submodules (innerdirs)
        if module in self.dirsmap:
            innerdirs = [(os.path.basename(module) +
                          '/' + os.path.basename(innerdir))
                         for innerdir in self.dirsmap[module]]
        # Create a list of documented modules
        # (represented by a doxygen file)
        innerfiles = [basename + "/" + os.path.basename(
            innerfile.rsplit(".", 1)[0])
                for innerfile in self.filesmap[module]]
        # Set jinja2-template, base or overloaded
        template = self.template_path / f"{module}.rst.j2"
        if template.exists():
            toc_template = env.get_template(f'{module}.rst.j2')
        else:
            toc_template = env.get_template(self.TOC_TEMPLATE)
        # Render template into a buffer
        buffer = toc_template.render(title=basename,
                                     refs=list(innerfiles) + innerdirs)
        # Create subdirectory on filesystem if needed
        os.makedirs(foldername, exist_ok=True)
        # Write out buffer to a file
        with toc_out.open("w") as output:
            os.makedirs(os.path.dirname(toc_out), exist_ok=True)
            output.write(buffer)
        # Create doxygen ref-files
        for filename in self.filesmap[module]:
            file = filename.rsplit(".", 1)[0]
            # Set jinja2-template, base or overloaded
            template = self.template_path / module / f"{file}.rst.j2"
            if template.exists():
                template = f"{module}/{file}.rst.j2"
                doxygenfile_template = env.get_template(template)
            else:
                doxygenfile_template = env.get_template(
                    self.DOXYFILE_TEMPLATE)
            # Render template into buffer
            buffer = doxygenfile_template.render(
                title=file, doxyfile=basename + "/" + filename)
            # Write out buffer to a file
            doxyfile_out = foldername / f"{file}.rst"
            with doxyfile_out.open("w") as output:
                output.write(buffer)