HEX
Server: Apache
System: Linux pdx1-shared-a1-38 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64
User: mmickelson (3396398)
PHP: 8.1.31
Disabled: NONE
Upload Files
File: //usr/lib/python3/dist-packages/sphinx/ext/__pycache__/extlinks.cpython-310.pyc
o

�$�a�
�@s�dZddlZddlmZmZmZmZddlmZm	Z	ddl
mZmZddl
mZddlZddlmZddlmZdd	lmZdd
lmZdeded
edefdd�Zdeddfdd�Zdedeeeffdd�ZdS)a�
    sphinx.ext.extlinks
    ~~~~~~~~~~~~~~~~~~~

    Extension to save typing and prevent hard-coding of base URLs in the reST
    files.

    This adds a new config value called ``extlinks`` that is created like this::

       extlinks = {'exmpl': ('https://example.invalid/%s.html', caption), ...}

    Now you can use e.g. :exmpl:`foo` in your documents.  This will create a
    link to ``https://example.invalid/foo.html``.  The link caption depends on
    the *caption* value given:

    - If it is ``None``, the caption will be the full URL.
    - If it is a string, it must contain ``%s`` exactly once.  In this case the
      caption will be *caption* with the role content substituted for ``%s``.

    You can also give an explicit caption, e.g. :exmpl:`Foo <foo>`.

    Both, the url string and the caption string must escape ``%`` as ``%%``.

    :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS.
    :license: BSD, see LICENSE for details.
�N)�Any�Dict�List�Tuple)�nodes�utils)�Node�system_message)�Inliner)�Sphinx)�RemovedInSphinx60Warning)�split_explicit_title)�RoleFunction�name�base_url�caption�returncs�z�dWnttfyt�dt���dd�d�Ynw�durDz�dWnttfyCt�dt���dd�d�Ynwigfdtdtd	td
tdtdt	d
t
tdtt
tt
t
ff��fdd�
}|S)N�dummyztextlinks: Sphinx-6.0 will require base URL to contain exactly one '%s' and all other '%' need to be escaped as '%%'.�%z%%z%sz|extlinks: Sphinx-6.0 will require a caption string to contain exactly one '%s' and all other '%' need to be escaped as '%%'.�typ�rawtext�text�lineno�inliner�options�contentrcsVt�|�}t|�\}}}	�|	}
|s�dur|
}n�|	}tj||d|
d�}|ggfS)NF)�internal�refuri)r�unescaper
r�	reference)rrrrrrr�has_explicit_title�title�part�full_url�pnode�rr��5/usr/lib/python3/dist-packages/sphinx/ext/extlinks.py�role@s

zmake_link_role.<locals>.role)�	TypeError�
ValueError�warnings�warnr�replace�str�intr
rrrrr	)rrrr(r&r%r'�make_link_role*s8���������
r0�appcCs2|jj��D]\}\}}|�|t|||��qdS)N)�config�extlinks�items�add_roler0)r1rrrr&r&r'�setup_link_rolesPs�r6cCs&|�did�|�dt�tjdd�S)Nr3�envzbuilder-initedT)�version�parallel_read_safe)�add_config_value�connectr6�sphinx�__display_version__)r1r&r&r'�setupUsr>)�__doc__r+�typingrrrr�docutilsrr�docutils.nodesrr	�docutils.parsers.rst.statesr
r<�sphinx.applicationr�sphinx.deprecationr�sphinx.util.nodesr
�sphinx.util.typingrr.r0r6r>r&r&r&r'�<module>s&