code: def run(self):
          
          if getLogger is not None:
              # Sphinx 1.6+
              logger = getLogger(__name__)
          else:
              # Previously Sphinx's app was also the logger
              logger = self.state.document.settings.env.app
  
          env = self.state.document.settings.env
          new_nodes = []
  
          # Get skip list
          skipped_modules = self._parse_skip_option()
  
          # List of homepage documents for each module
          module_index_files = []
  
          # Collect paths with the form `modules/<module-name>/index`
          for docname in _filter_index_pages(env.found_docs, 'modules'):
              logger.debug('module-toctree found %s', docname)
              if self._parse_module_name(docname) in skipped_modules:
                  logger.debug('module-toctree skipped %s', docname)
                  continue
              module_index_files.append(docname)
          module_index_files.sort()
          entries = [(None, docname) for docname in module_index_files]
          logger.debug('module-toctree found %d modules',
                       len(module_index_files))
  
          # Add the toctree's node itself
          subnode = _build_toctree_node(
              parent=env.docname,
              entries=entries,
              includefiles=module_index_files,
              caption=None)
          set_source_info(self, subnode)  # Sphinx TocTree does this.
  
          wrappernode = docutils.nodes.compound(classes=['toctree-wrapper',
                                                         'module-toctree'])
          wrappernode.append(subnode)
          self.add_name(wrappernode)
          new_nodes.append(wrappernode)
  
          return new_nodes
docs: Main entrypoint method.
  
          Returns
          -------
          new_nodes : `list`
              Nodes to add to the doctree.