o
    Ni                     @  s|   d Z ddlmZ ddlmZmZ ddlmZmZ ddl	m
Z
 er,ddlmZ ddlmZ G dd	 d	eZG d
d deZdS )zDomain indices.    )annotations)ABCabstractmethod)TYPE_CHECKING
NamedTuple)SphinxError)Iterable)Domainc                   @  sJ   e Zd ZU dZded< ded< ded< ded< ded< ded	< ded
< dS )
IndexEntryz
    An index entry.

    .. note::

       The *qualifier* and *description* are not rendered for some output formats,
       such as LaTeX.
    strnameintsubtypedocnameanchorextra	qualifierdescrN)__name__
__module____qualname____doc____annotations__ r   r   I/home/ubuntu/.local/lib/python3.10/site-packages/sphinx/domains/_index.pyr
      s   
 

r
   c                   @  sJ   e Zd ZU dZded< ded< dZded< dddZe	ddddZdS )Indexa  
    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.
    r   r   	localnameNz
str | None	shortnamedomainr	   returnNonec                 C  s2   | j r| jd u rd| jj d}t||| _d S )NzIndex subclass z has no valid name or localname)r   r   	__class__r   r   r   )selfr   msgr   r   r   __init__R   s   
zIndex.__init__docnamesIterable[str] | None/tuple[list[tuple[str, list[IndexEntry]]], bool]c                 C  s   t )a  Get entries for the index.

        If ``docnames`` is given, restrict to entries referring to these
        docnames.

        The return value is a tuple of ``(content, collapse)``:

        ``collapse``
          A boolean that determines if sub-entries should start collapsed (for
          output formats that support collapsing sub-entries).

        ``content``:
          A sequence of ``(letter, entries)`` tuples, where ``letter`` is the
          "heading" for the given ``entries``, usually the starting letter, and
          ``entries`` is a sequence of single entries.
          Each entry is an :py:class:`IndexEntry`.
        )NotImplementedError)r"   r%   r   r   r   generateX   s   zIndex.generate)r   r	   r   r    )N)r%   r&   r   r'   )	r   r   r   r   r   r   r$   r   r)   r   r   r   r   r   7   s   
 
r   N)r   
__future__r   abcr   r   typingr   r   sphinx.errorsr   collections.abcr   sphinx.domainsr	   r
   r   r   r   r   r   <module>   s    '