def add_target_and_index(self, name, sig, signode):
        slug = re.sub(r'\W+', '-', name).lower()

        if slug not in self.state.document.ids:
            signode['names'].append(slug)
            signode['ids'].append(slug)
            signode['first'] = (not self.names)
            self.state.document.note_explicit_target(signode)
            inv = self.env.domaindata['sublime']['objects']
            # if name in inv:
            #     self.state_machine.reporter.warning(
            #         'duplicate C object description of %s, ' % name +
            #         'other instance in ' + self.env.doc2path(inv[name][0]),
            #         line=self.lineno)
            inv[name] = (self.env.docname, self.objtype)
            #print inv[name]

        indextext = self.get_index_text(name)
        if indextext:
            self.indexnode['entries'].append(('single', indextext, slug, ''))

        # signode['ids'].append(clean_name)
        # self.env.domaindata['sublime'][sig] = (self.env.docname, '')
        # self.indexnode['entries'].append(('single', u'name', u'fullname', ''))
dataset/ETHPy150Open SublimeGit/SublimeGit/docs/sublimedoc/__init__.py/SublimeWindowCommand.add_target_and_index/original