class_docstr: An Index is the description for a domain-specific index.  To add an index to
  a domain, subclass Index, overriding the three name attributes:
  
  * `name` is an identifier used for generating file names.
    It is also used for a hyperlink target for the index. Therefore, users can
    refer the index page using ``ref`` role and a string which is combined
    domain name and ``name`` attribute (ex. ``:ref:`py-modindex```).
  * `localname` is the section title for the index.
  * `shortname` is a short name for the index, for use in the relation bar in
    HTML output.  Can be empty to disable entries in the relation bar.
  
  and providing a :meth:`generate()` method.  Then, add the index class to
  your domain's `indices` list.  Extensions can add indices to existing
  domains using :meth:`~sphinx.application.Sphinx.add_index_to_domain()`.
  
  .. versionchanged:: 3.0
  
     Index pages can be referred by domain name and index name via
     :rst:role:`ref` role.
class_docstr_tok: ["An","Index","is","the","description","for","a","domain-specific","index",".","To","add","an","index","to","a","domain",",","subclass","Index",",","overriding","the","three","name","attributes",":","*","`","name","`","is","an","identifier","used","for","generating","file","names",".","It","is","also","used","for","a","hyperlink","target","for","the","index",".","Therefore",",","users","can","refer","the","index","page","using","``","ref","``","role","and","a","string","which","is","combined","domain","name","and","``","name","``","attribute","(","ex",".","``",":","ref",":","`","py-modindex","``","`",")",".","*","`","localname","`","is","the","section","title","for","the","index",".","*","`","shortname","`","is","a","short","name","for","the","index",",","for","use","in","the","relation","bar","in","HTML","output",".","Can","be","empty","to","disable","entries","in","the","relation","bar",".","and","providing","a",":","meth",":","`","generate","(",")","`","method",".","Then",",","add","the","index","class","to","your","domain","'s","`","indices","`","list",".","Extensions","can","add","indices","to","existing","domains","using",":","meth",":","`","~sphinx.application.Sphinx.add_index_to_domain","(",")","`",".","..","versionchanged",":",":","3.0","Index","pages","can","be","referred","by","domain","name","and","index","name","via",":","rst",":","role",":","`","ref","`","role","."]
code: def __init__(self, domain: Domain) -> None:
      if not self.name or self.localname is None:
          raise SphinxError(
              "Index subclass %s has no valid name or localname"
              % self.__class__.__name__
          )
      self.domain = domain
  
imports: from __future__ import annotations
  import copy
  from abc import ABC, abstractmethod
  from typing import TYPE_CHECKING, Any, Callable, NamedTuple, Optional, cast
  from docutils.nodes import Element, Node, system_message
  from sphinx.errors import SphinxError
  from sphinx.locale import _
label_desc: Use image node_id 1 to create a new Index object from inherited base classes: ABC with example: obj = Index(domain)