code: def resolve_ref(cls, domain, env, fromdocname, builder, typ, target, node,
                      contnode):
          
          # indexes appear to be automatically generated at doc DOMAIN-NAME
          todocname = "bb-%s" % target
  
          node = nodes.reference('', '', internal=True)
          node['refuri'] = builder.get_relative_uri(fromdocname, todocname)
          node['reftitle'] = cls.localname
          node.append(nodes.emphasis(cls.localname, cls.localname))
          return node
docs: Resolve a reference to an index to the document containing the index,
          using the index's C{localname} as the content of the link.