
    2yib                    v   d Z ddlmZ ddlZddlZddlmZmZmZm	Z	m
Z
mZmZmZ ej                  dk\  r	ddlmZmZ nddlmZmZ erddlZddlmZ ddlmZmZmZmZmZ er$dd	lmZ dd
lm Z  ddl!m"Z" ddl#m$Z$ ddl%m&Z& ddl'm(Z( er	ddl)m*Z*m+Z+ neZ+ e+d      Z, ed      Z- ej\                  d      Z/d"dZ0 ede      Z1 G d de	e1         Z2 e3d e2jh                  D              Z5e5D ]  Z6 e7e2de6z           d#dZ8 G d de	e,e-f         Z9 G d de:ee;e2f         Z< G d d ejz                        Z>d$d!Z?y)%z%Implements the plugin API for MkDocs.    )annotationsN)TYPE_CHECKINGAnyCallableGenericLiteralMutableMappingTypeVaroverload)   
   )
EntryPointentry_points)utils)ConfigConfigErrorsConfigWarningsLegacyConfigPlainConfigSchema)MkDocsConfig)LiveReloadServer)Files)
Navigation)Page)TemplateContext)Concatenate	ParamSpecPTmkdocs.pluginsc                     t        d      } i }| D ];  }|j                  |v r|j                  j                  d      r-|||j                  <   = |S )z=Return a dict of all installed Plugins as {name: EntryPoint}.r    )groupzmkdocs.contrib.)r   namevalue
startswith)plugins	pluginmapplugins      P/var/www/html/content_weaver/venv/lib/python3.12/site-packages/mkdocs/plugins.pyget_pluginsr*   (   sZ    !12G I (;;)#(?(?@Q(R!'	&++	(     
SomeConfig)boundc                     e Zd ZU dZeZded<   dZded<   i Zded<   d	Z	d
ed<   	 d#dZ
d Z	 d$	 	 	 	 	 d%dZd&dZd'dZ	 	 	 	 	 	 	 	 d(dZd)dZd*dZd+dZ	 	 	 	 	 	 	 	 d,dZ	 	 	 	 	 	 	 	 d-dZd*dZd.dZ	 	 	 	 	 	 	 	 d/dZ	 	 	 	 	 	 	 	 d0dZ	 	 	 	 	 	 	 	 d1dZd2dZd3dZ	 	 	 	 	 	 	 	 	 	 d4dZ	 	 	 	 	 	 	 	 	 	 d5d Z	 	 	 	 	 	 	 	 	 	 d6d!Zd7d"Zy)8
BasePluginzI
    Plugin base class.

    All plugins should subclass this class.
    ztype[SomeConfig]config_class r   config_schemer,   configFboolsupports_multiple_instancesc                j    | j                    d|j                    d}t        || ft        |            S )z_Eliminates the need to write `config_class = FooConfig` when subclassing BasePlugin[FooConfig].[])r0   )__name__typedict)clsr0   r#   s      r)   __class_getitem__zBasePlugin.__class_getitem__H   s5    ,,q!6!6 7q9D3&$L"ABBr+   c                    t        | j                  t              st        d| j                   d      | j                  t        ur| j                  j
                  | _        y y )Nzconfig_class z2 must be a subclass of `mkdocs.config.base.Config`)
issubclassr0   r   	TypeErrorr   _schemar2   )r<   s    r)   __init_subclass__zBasePlugin.__init_subclass__M   s\    #**F3 0 011cd  </ # 0 0 8 8C 0r+   Nc                    | j                   t        u rt        | j                  |      | _        n| j                  |      | _        | j                  j	                  |       | j                  j                         S )zJLoad config from a dict of options. Returns a tuple of (errors, warnings).)config_file_path)r0   r   r2   r3   	load_dictvalidate)selfoptionsrD   s      r)   load_configzBasePlugin.load_configU   sb     ,&t'9'9L\]DK++=M+NDKg&{{##%%r+   c                    y)a  
        The `startup` event runs once at the very beginning of an `mkdocs` invocation.

        New in MkDocs 1.4.

        The presence of an `on_startup` method (even if empty) migrates the plugin to the new
        system where the plugin object is kept across builds within one `mkdocs serve`.

        Note that for initializing variables, the `__init__` method is still preferred.
        For initializing per-build variables (and whenever in doubt), use the `on_config` event.

        Args:
            command: the command that MkDocs was invoked with, e.g. "serve" for `mkdocs serve`.
            dirty: whether `--dirty` flag was passed.
        Nr1   rG   commanddirtys      r)   
on_startupzBasePlugin.on_startupd       r+   c                     y)a  
        The `shutdown` event runs once at the very end of an `mkdocs` invocation, before exiting.

        This event is relevant only for support of `mkdocs serve`, otherwise within a
        single build it's undistinguishable from `on_post_build`.

        New in MkDocs 1.4.

        The presence of an `on_shutdown` method (even if empty) migrates the plugin to the new
        system where the plugin object is kept across builds within one `mkdocs serve`.

        Note the `on_post_build` method is still preferred for cleanups, when possible, as it has
        a much higher chance of actually triggering. `on_shutdown` is "best effort" because it
        relies on detecting a graceful shutdown of MkDocs.
        Nr1   rG   s    r)   on_shutdownzBasePlugin.on_shutdownu   rO   r+   c                  |S )av  
        The `serve` event is only called when the `serve` command is used during
        development. It runs only once, after the first build finishes.
        It is passed the `Server` instance which can be modified before
        it is activated. For example, additional files or directories could be added
        to the list of "watched" files for auto-reloading.

        Args:
            server: `livereload.Server` instance
            config: global configuration object
            builder: a callable which gets passed to each call to `server.watch`

        Returns:
            `livereload.Server` instance
        r1   rG   serverr3   builders       r)   on_servezBasePlugin.on_serve   s	    $ r+   c                    |S )aP  
        The `config` event is the first event called on build and is run immediately
        after the user configuration is loaded and validated. Any alterations to the
        config should be made here.

        Args:
            config: global configuration object

        Returns:
            global configuration object
        r1   rG   r3   s     r)   	on_configzBasePlugin.on_config   s	     r+   c                    y)z
        The `pre_build` event does not alter any variables. Use this event to call
        pre-build scripts.

        Args:
            config: global configuration object
        Nr1   rY   s     r)   on_pre_buildzBasePlugin.on_pre_build   rO   r+   c                  |S )a  
        The `files` event is called after the files collection is populated from the
        `docs_dir`. Use this event to add, remove, or alter files in the
        collection. Note that Page objects have not yet been associated with the
        file objects in the collection. Use [Page Events](plugins.md#page-events) to manipulate page
        specific data.

        Args:
            files: global files collection
            config: global configuration object

        Returns:
            global files collection
        r1   rG   filesr3   s      r)   on_fileszBasePlugin.on_files   s	     r+   c                  |S )aQ  
        The `nav` event is called after the site navigation is created and can
        be used to alter the site navigation.

        Args:
            nav: global navigation object
            config: global configuration object
            files: global files collection

        Returns:
            global navigation object
        r1   rG   navr3   r_   s       r)   on_navzBasePlugin.on_nav   s	     
r+   c                  |S )a  
        The `env` event is called after the Jinja template environment is created
        and can be used to alter the
        [Jinja environment](https://jinja.palletsprojects.com/en/latest/api/#jinja2.Environment).

        Args:
            env: global Jinja environment
            config: global configuration object
            files: global files collection

        Returns:
            global Jinja Environment
        r1   rG   envr3   r_   s       r)   on_envzBasePlugin.on_env   s	      
r+   c                    y)z
        The `post_build` event does not alter any variables. Use this event to call
        post-build scripts.

        Args:
            config: global configuration object
        Nr1   rY   s     r)   on_post_buildzBasePlugin.on_post_build   rO   r+   c                    y)a  
        The `build_error` event is called after an exception of any kind
        is caught by MkDocs during the build process.
        Use this event to clean things up before MkDocs terminates. Note that any other
        events which were scheduled to run after the error will have been skipped. See
        [Handling Errors](plugins.md#handling-errors) for more details.

        Args:
            error: exception raised
        Nr1   rG   errors     r)   on_build_errorzBasePlugin.on_build_error   rO   r+   c                  |S )a  
        The `pre_template` event is called immediately after the subject template is
        loaded and can be used to alter the template.

        Args:
            template: a Jinja2 [Template](https://jinja.palletsprojects.com/en/latest/api/#jinja2.Template) object
            template_name: string filename of template
            config: global configuration object

        Returns:
            a Jinja2 [Template](https://jinja.palletsprojects.com/en/latest/api/#jinja2.Template) object
        r1   rG   templatetemplate_namer3   s       r)   on_pre_templatezBasePlugin.on_pre_template   s	     r+   c                  |S )a  
        The `template_context` event is called immediately after the context is created
        for the subject template and can be used to alter the context for that specific
        template only.

        Args:
            context: dict of template context variables
            template_name: string filename of template
            config: global configuration object

        Returns:
            dict of template context variables
        r1   rG   contextrr   r3   s       r)   on_template_contextzBasePlugin.on_template_context  	      r+   c                  |S )a  
        The `post_template` event is called after the template is rendered, but before
        it is written to disc and can be used to alter the output of the template.
        If an empty string is returned, the template is skipped and nothing is is
        written to disc.

        Args:
            output_content: output of rendered template as string
            template_name: string filename of template
            config: global configuration object

        Returns:
            output of rendered template as string
        r1   rG   output_contentrr   r3   s       r)   on_post_templatezBasePlugin.on_post_template!  s
    " r+   c                  |S )a  
        The `pre_page` event is called before any actions are taken on the subject
        page and can be used to alter the `Page` instance.

        Args:
            page: `mkdocs.structure.pages.Page` instance
            config: global configuration object
            files: global files collection

        Returns:
            `mkdocs.structure.pages.Page` instance
        r1   rG   pager3   r_   s       r)   on_pre_pagezBasePlugin.on_pre_page6  s	     r+   c                   y)a  
        > DEPRECATED: Instead of this event, prefer one of these alternatives:
        >
        > * Since MkDocs 1.6, instead set `content_bytes`/`content_string` of a `File` inside [`on_files`][].
        > * Usually (although it's not an exact alternative), `on_page_markdown` can serve the same purpose.

        The `on_page_read_source` event can replace the default mechanism to read
        the contents of a page's source from the filesystem.

        Args:
            page: `mkdocs.structure.pages.Page` instance
            config: global configuration object

        Returns:
            The raw source for a page as unicode string. If `None` is returned, the
                default loading from a file will be performed.
        Nr1   rG   r   r3   s      r)   on_page_read_sourcezBasePlugin.on_page_read_sourceE  s    $ r+   c                  |S )a  
        The `page_markdown` event is called after the page's markdown is loaded
        from file and can be used to alter the Markdown source text. The meta-
        data has been stripped off and is available as `page.meta` at this point.

        Args:
            markdown: Markdown source text of page as string
            page: `mkdocs.structure.pages.Page` instance
            config: global configuration object
            files: global files collection

        Returns:
            Markdown source text of page as string
        r1   rG   markdownr   r3   r_   s        r)   on_page_markdownzBasePlugin.on_page_markdownY  s	    " r+   c                  |S )a  
        The `page_content` event is called after the Markdown text is rendered to
        HTML (but before being passed to a template) and can be used to alter the
        HTML body of the page.

        Args:
            html: HTML rendered from Markdown source as string
            page: `mkdocs.structure.pages.Page` instance
            config: global configuration object
            files: global files collection

        Returns:
            HTML rendered from Markdown source as string
        r1   rG   htmlr   r3   r_   s        r)   on_page_contentzBasePlugin.on_page_contentl  s	    " r+   c                  |S )a  
        The `page_context` event is called after the context for a page is created
        and can be used to alter the context for that specific page only.

        Args:
            context: dict of template context variables
            page: `mkdocs.structure.pages.Page` instance
            config: global configuration object
            nav: global navigation object

        Returns:
            dict of template context variables
        r1   rG   rv   r   r3   rc   s        r)   on_page_contextzBasePlugin.on_page_context  rx   r+   c                  |S )a  
        The `post_page` event is called after the template is rendered, but
        before it is written to disc and can be used to alter the output of the
        page. If an empty string is returned, the page is skipped and nothing is
        written to disc.

        Args:
            output: output of rendered template as string
            page: `mkdocs.structure.pages.Page` instance
            config: global configuration object

        Returns:
            output of rendered template as string
        r1   rG   outputr   r3   s       r)   on_post_pagezBasePlugin.on_post_page  s	     r+   )r0   ztype[Config]N)rH   zdict[str, Any]rD   
str | Nonereturnz#tuple[ConfigErrors, ConfigWarnings]rL   z&Literal['build', 'gh-deploy', 'serve']rM   r4   r   Noner   r   )rU   r   r3   r   rV   r   r   zLiveReloadServer | None)r3   r   r   zMkDocsConfig | Noner3   r   r   r   )r_   r   r3   r   r   zFiles | None)rc   r   r3   r   r_   r   r   zNavigation | None)rg   jinja2.Environmentr3   r   r_   r   r   zjinja2.Environment | Nonerm   	Exceptionr   r   )rq   jinja2.Templaterr   strr3   r   r   zjinja2.Template | None)rv   r   rr   r   r3   r   r   TemplateContext | None)r{   r   rr   r   r3   r   r   r   )r   r   r3   r   r_   r   r   zPage | Noner   r   r3   r   r   r   )
r   r   r   r   r3   r   r_   r   r   r   )
r   r   r   r   r3   r   r_   r   r   r   )
rv   r   r   r   r3   r   rc   r   r   r   )r   r   r   r   r3   r   r   r   ) r9   
__module____qualname____doc__r   r0   __annotations__r2   r3   r5   r=   rB   rI   rN   rR   rW   rZ   r\   r`   rd   rh   rj   rn   rs   rw   r|   r   r   r   r   r   r   r1   r+   r)   r/   r/   :   s    &2L"1')M$)FJ(--aC
9 GK&%&9C&	,&""&6BMU	 ,"-9BG	"%5AJO	"$
'>AKW	"&=@JV	$!8;EQ	*()-7CLQ	&%)3?HM	&&48BNU_	$r+   r/   c              #  J   K   | ]  }|j                  d       s|dd   yw)on_r   Nr%   ).0ks     r)   	<genexpr>r     s!     IQ\\%5HquIs   #
#r   c                      fd}|S )a  
    A decorator to set an event priority for an event handler method.

    Recommended priority values:
    `100` "first", `50` "early", `0` "default", `-50` "late", `-100` "last".
    As different plugins discover more precise relations to each other, the values should be further tweaked.

    Usage example:

    ```python
    @plugins.event_priority(-100)  # Wishing to run this after all other plugins' `on_files` events.
    def on_files(self, files, config, **kwargs):
        ...
    ```

    New in MkDocs 1.4.
    Recommended shim for backwards compatibility:

    ```python
    try:
        from mkdocs.plugins import event_priority
    except ImportError:
        event_priority = lambda priority: lambda f: f  # No-op fallback
    ```
    c                    | _         | S r   )mkdocs_priority)event_methodprioritys    r)   	decoratorz!event_priority.<locals>.decorator  s    '/$r+   r1   )r   r   s   ` r)   event_priorityr     s    6 r+   c                  (    e Zd ZdZddZddZddZy)	CombinedEventa`  
    A descriptor that allows defining multiple event handlers and declaring them under one event's name.

    Usage example:

    ```python
    @plugins.event_priority(100)
    def _on_page_markdown_1(self, markdown: str, **kwargs):
        ...

    @plugins.event_priority(-50)
    def _on_page_markdown_2(self, markdown: str, **kwargs):
        ...

    on_page_markdown = plugins.CombinedEvent(_on_page_markdown_1, _on_page_markdown_2)
    ```

    NOTE: The names of the sub-methods **can't** start with `on_`;
    instead they can start with `_on_` like in the the above example, or anything else.
    c                    || _         y r   )methods)rG   r   s     r)   __init__zCombinedEvent.__init__  s	    r+   c                D    t        t        |       j                  d      )Nz object is not callable)r@   r:   r9   )rG   instanceargskwargss       r)   __call__zCombinedEvent.__call__  s     4:..11HIJJr+   Nc                >    t        fd| j                  D         S )Nc              3  B   K   | ]  }|j                          y wr   )__get__)r   fr   owners     r)   r   z(CombinedEvent.__get__.<locals>.<genexpr>  s     Paqyy59Ps   )r   r   )rG   r   r   s    ``r)   r   zCombinedEvent.__get__  s    P4<<PQQr+   )r   z Callable[Concatenate[Any, P], T])r   r/   r   zP.argsr   zP.kwargsr   r   r   )r9   r   r   r   r   r   r   r1   r+   r)   r   r     s    *KRr+   r   c                      e Zd ZU dZded<   d fdZ	 d	 	 	 	 	 	 	 d dZd! fdZd" fdZe	d#d       Z
e	d$d	       Z
dd%d
Z
d&dZddZ	 	 	 	 	 	 	 	 d'dZd(dZd)dZd*dZd+dZd,dZd)dZd-dZ	 	 	 	 	 	 	 	 d.dZ	 	 	 	 	 	 	 	 d/dZ	 	 	 	 	 	 	 	 d0dZd1dZd2dZ	 	 	 	 	 	 	 	 	 	 d3dZd4dZ	 	 	 	 	 	 	 	 	 	 d5dZd6dZ xZS )7PluginCollectionz
    A collection of plugins.

    In addition to being a dict of Plugin instances, each event method is registered
    upon being added. All registered methods for a given event can then be run in order
    by calling `run_event`.
    r   _current_pluginc                p    t        |   |i | t        D ci c]  }|g  c}| _        i | _        y c c}w r   )superr   EVENTSevents_event_origins)rG   r   r   r   	__class__s       r)   r   zPluginCollection.__init__  s9    $)&)AG1HA!R%1H35 2Is   
3c                   t        |t              r&|j                  D ]  }| j                  |||        y
| j                  |   }|dk(  r^t        |      dk(  rP| j                  j                  t        t        |            d      }|xs d}t        j                  d| d| d       t        j                  ||d 	       |r	 || j                  |<   y
y
# t        $ r Y y
w xY w)zRegister a method for an event.plugin_namepage_read_source   	<unknown>zBMultiple 'on_page_read_source' handlers can't work (both plugins 'z' and 'z' registered one).c                    t        | dd       S )Nr   r   )getattr)ms    r)   <lambda>z2PluginCollection._register_event.<locals>.<lambda>  s    CTVW8X7X r+   )keyN)
isinstancer   r   _register_eventr   lenr   getnextiterlogwarningr   insortr@   )rG   
event_namemethodr   subr   plugin1plugin2s           r)   r   z PluginCollection._register_event  s     fm,~~ O$$Z+$NO [[,F//CK14D--11$tF|2DkR%4&&-YggY>PR LL-XY2=D''/  ! s   C 	C"!C"c                "    t         |   |      S r   )r   __getitem__)rG   r   r   s     r)   r   zPluginCollection.__getitem__  s    w"3''r+   c                    t         |   ||       d t        |      D        D ]2  }t        ||d       }t	        |      s| j                  |dd  ||       4 y )Nc              3  D   K   | ]  }|j                  d       s|  yw)r   Nr   )r   xs     r)   r   z/PluginCollection.__setitem__.<locals>.<genexpr>  s     HALL4G1Hs     r   r   )r   __setitem__dirr   callabler   )rG   r   r$   r   r   r   s        r)   r   zPluginCollection.__setitem__  s]    C'Hc%jH 	NJUJ5F$$Z^V$M	Nr+   c                     y r   r1   )rG   r#   r   s      r)   	run_eventzPluginCollection.run_event      r+   c                     y r   r1   )rG   r#   itemr   s       r)   r   zPluginCollection.run_event#  r   r+   c                N   |du}| j                   |   D ]  }| j                  j                  |d      | _        t        j                         t        j                  k  r&t        j                  d| d| j                   d       |r
 ||fi |}n |di |}||} d| _        |S )a[  
        Run all registered methods of an event.

        `item` is the object to be modified or replaced and returned by the event method.
        If it isn't given the event method creates a new object to be returned.
        All other keywords are variables for context, but would not generally
        be modified by the event method.
        Nr   z	Running `z` event from plugin ''r1   )	r   r   r   r   r   getEffectiveLevelloggingDEBUGdebug)rG   r#   r   r   	pass_itemr   results          r)   r   zPluginCollection.run_event'  s     $	kk$' 
	F#'#6#6#:#:6;#OD $$&'--7		IdV+@AUAU@VVWXY//)&)!
	  $r+   c               *    | j                  d||      S )Nstartup)rL   rM   r   rK   s      r)   rN   zPluginCollection.on_startup?  s    ~~i~FFr+   c                $    | j                  d      S )Nshutdownr   rQ   s    r)   rR   zPluginCollection.on_shutdownB  s    ~~j))r+   c               ,    | j                  d|||      S )Nserve)r3   rV   r   rT   s       r)   rW   zPluginCollection.on_serveE  s     ~~gvfg~NNr+   c                &    | j                  d|      S )Nr3   r   rY   s     r)   rZ   zPluginCollection.on_configJ  s    ~~h//r+   c               (    | j                  d|      S )N	pre_buildr3   r   rY   s     r)   r\   zPluginCollection.on_pre_buildM  s    ~~k&~99r+   c               *    | j                  d||      S )Nr_   r  r   r^   s      r)   r`   zPluginCollection.on_filesP  s    ~~guV~<<r+   c               ,    | j                  d|||      S )Nrc   r3   r_   r   rb   s       r)   rd   zPluginCollection.on_navS      ~~eSu~EEr+   c               ,    | j                  d|||      S )Nrg   r  r   rf   s       r)   rh   zPluginCollection.on_envV  r  r+   c               (    | j                  d|      S )N
post_buildr  r   rY   s     r)   rj   zPluginCollection.on_post_buildY  s    ~~l6~::r+   c               (    | j                  d|      S )Nbuild_error)rm   r   rl   s     r)   rn   zPluginCollection.on_build_error\  s    ~~m5~99r+   c               ,    | j                  d|||      S )Npre_templaterr   r3   r   rp   s       r)   rs   z PluginCollection.on_pre_template_  s     ~~nhm\b~ccr+   c               ,    | j                  d|||      S )Ntemplate_contextr  r   ru   s       r)   rw   z$PluginCollection.on_template_contextd  s#     ~~}V  
 	
r+   c               ,    | j                  d|||      S )Npost_templater  r   rz   s       r)   r|   z!PluginCollection.on_post_templatek  s$     ~~^=QW  
 	
r+   c               ,    | j                  d|||      S )Npre_pager  r   r~   s       r)   r   zPluginCollection.on_pre_pager  s    ~~j$vU~KKr+   c               *    | j                  d||      S )Nr   r   r3   r   r   s      r)   r   z$PluginCollection.on_page_read_sourceu  s    ~~0tF~KKr+   c               .    | j                  d||||      S )Npage_markdownr   r3   r_   r   r   s        r)   r   z!PluginCollection.on_page_markdownx  s     ~~oxd6Y^~__r+   c               .    | j                  d||||      S )Npage_contentr  r   r   s        r)   r   z PluginCollection.on_page_content}  s    ~~ndfTY~ZZr+   c               .    | j                  d||||      S )Npage_context)r   r3   rc   r   r   s        r)   r   z PluginCollection.on_page_context  s     ~~ngDUX~YYr+   c               ,    | j                  d|||      S )N	post_pager  r   r   s       r)   r   zPluginCollection.on_post_page  s    ~~k6V~LLr+   r   r   )r   r   r   zCombinedEvent | Callabler   r   r   r   )r   r   r   r/   )r   r   r$   r/   r   r   )r#   r   r   r   )r#   r   r   r   r   r   )r#   r   r   )rU   r   r3   r   rV   r   r   r   )r3   r   r   r   r   )r_   r   r3   r   r   r   )rc   r   r3   r   r_   r   r   r   )rg   r   r3   r   r_   r   r   )rq   r   rr   r   r3   r   r   r   )rv   r   rr   r   r3   r   r   r   )r{   r   rr   r   r3   r   r   r   )r   r   r3   r   r_   r   r   r   r   )
r   r   r   r   r3   r   r_   r   r   r   )
r   r   r   r   r3   r   r_   r   r   r   )
rv   r   r   r   r3   r   rc   r   r   r   )r   r   r   r   r3   r   r   r   )r9   r   r   r   r   r   r   r   r   r   r   rN   rR   rW   rZ   r\   r`   rd   rh   rj   rn   rs   rw   r|   r   r   r   r   r   r   __classcell__r   s   @r)   r   r     s     6 \`'?NX	.(N    0G*O&O3?OJRO	O
0:=FF;:d'd;>dHTd	d

&
:=
GS
	

!
58
BN
	
LL``&*`4@`IN`	`
[Z&Z15Z?KZR\Z	Z
Mr+   r   c                  ,     e Zd ZdZd fdZddZ xZS )PrefixedLoggerz(A logger adapter to prefix log messages.c                4    t         |   |i        || _        y)z
        Initialize the logger adapter.

        Arguments:
            prefix: The string to insert in front of every message.
            logger: The logger instance.
        N)r   r   prefix)rG   r%  loggerr   s      r)   r   zPrefixedLogger.__init__  s     	$r+   c                (    | j                    d| |fS )z
        Process the message.

        Arguments:
            msg: The message:
            kwargs: Remaining arguments.

        Returns:
            The processed message.
        z: )r%  )rG   msgr   s      r)   processzPrefixedLogger.process  s     ++b&..r+   )r%  r   r&  zlogging.Loggerr   r   )r(  r   r   zMutableMapping[str, Any]r   ztuple[str, Any])r9   r   r   r   r   r)  r   r!  s   @r)   r#  r#    s    2	/r+   r#  c                p    t        j                  d|        }t        | j                  dd      d   |      S )a  
    Return a logger for plugins.

    Arguments:
        name: The name to use with `logging.getLogger`.

    Returns:
        A logger configured to work well in MkDocs,
            prefixing each message with the plugin package name.

    Example:
        ```python
        from mkdocs.plugins import get_plugin_logger

        log = get_plugin_logger(__name__)
        log.info("My plugin message")
        ```
    zmkdocs.plugins..r   r   )r   	getLoggerr#  split)r#   r&  s     r)   get_plugin_loggerr.    s8    & 78F$**S!,Q/88r+   )r   zdict[str, EntryPoint])r   floatr   zCallable[[T], T])r#   r   r   r#  )@r   
__future__r   r   systypingr   r   r   r   r   r	   r
   r   version_infoimportlib.metadatar   r   importlib_metadatajinja2.environmentjinja2mkdocsr   mkdocs.config.baser   r   r   r   r   mkdocs.config.defaultsr   mkdocs.livereloadr   mkdocs.structure.filesr   mkdocs.structure.navr   mkdocs.structure.pagesr   mkdocs.utils.templatesr   typing_extensionsr   r   r   r   r,  r   r*   r,   r/   tuple__dict__r   r   delattrr   r   r;   r   r   LoggerAdapterr#  r.  r1   r+   r)   <module>rE     s8   + "  
 d d dw;;;  d d32,/+688IcNCL g() \0
f$ fR 
Ij11I	I 
 #AJ	"#DRGAqDM RBYMt^CO< YMx/W** /89r+   