
    -e                        d Z ddlmZ ddlZ ej        e          ZddlZddlZddl	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 dd
lmZ ddlmZ dZ G d de          Zd ZdS )a   Thoroughly document Bokeh property attributes.

The ``bokeh-prop`` directive generates documentation for Bokeh model properties,
including cross links to the relevant property types. Additionally, any
per-attribute help strings are also displayed.

This directive takes the name *(class.attr)* of a Bokeh property as its
argument and the module as an option:

.. code-block:: rest

    .. bokeh-prop:: Bar.thing
        :module: bokeh.sphinxext.sample

Examples
--------

For the following definition of ``bokeh.sphinxext.sample.Bar``:

.. code-block:: python

    class Bar(Model):
        ''' This is a Bar model. '''
        thing = List(Int, help="doc for thing")

the above usage yields the output:

    .. bokeh-prop:: Bar.thing
        :module: bokeh.sphinxext.sample


The ``bokeh-prop`` direction may be used explicitly, but it can also be used
in conjunction with the :ref:`bokeh.sphinxext.bokeh_autodoc` extension.

To enable this extension, add `"bokeh.sphinxext.bokeh_prop"` to the
extensions list in your Sphinx configuration module.

    )annotationsN)	unchanged)SphinxError)	type_link)BokehDeprecationWarning   )PARALLEL_SAFE)BokehDirective)PROP_DETAIL)BokehPropDirectivesetupc                  *    e Zd ZdZdZdZeedZd ZdS )r   Tr      )moduletypec           	     `   | j         d         }|                    d          \  }}| j        d         }	 t          j        |          }n## t
          $ r t          d| d|           w xY wt          ||d           }|t          d| d| d|           t          j	                    5  t          j
        d	t          
            |            }d d d            n# 1 swxY w Y   	 |                    |          }n&# t          $ r t          d| d| d|           w xY wt          j        || j        d         t!          |                    |                    t%          |j                  |j        dnt+          j        |j                            }	|                     |	d          S )Nr   .r   z&Could not generate reference docs for z: could not import module z&Unable to generate reference docs for z: no model z in module ignore)categoryz: no property z
 on model  )namer   default	type_infodocz<bokeh-prop>)	argumentsrsplitoptions	importlibimport_moduleImportErrorr   getattrwarningscatch_warningsfilterwarningsr   lookupAttributeErrorr   renderreprinstance_defaultr   property__doc__textwrapdedentparse)
self	full_name
model_name	prop_namemodule_namer   model	model_obj
descriptorrst_texts
             :lib/python3.11/site-packages/bokeh/sphinxext/bokeh_prop.pyrunzBokehPropDirective.runf   sp   N1%	 ) 0 0 5 5
Il8,	{,[99FF 	{ 	{ 	{yyyylwyyzzz	{ 
D11=  By  B  B]g  B  Bt  B  B  C  C  C
 $&& 	  	 #H7NOOOOI	  	  	  	  	  	  	  	  	  	  	  	  	  	  	 	C")))44JJ 	C 	C 	C  By  B  B`i  B  Bu  B  B  C  C  C	C %<)44Y??@@
 344 (0hojFX6Y6Y
 
 
 zz(N333s)   A	 	 A)*&CC #C (C> >#D!N)	__name__
__module____qualname__has_contentrequired_argumentsoptional_argumentsr   option_specr9        r8   r   r   _   sA        K&	::K#4 #4 #4 #4 #4rB   r   c                H    |                      ddt                     t          S )z+ Required Sphinx extension setup function. pyz
bokeh-prop)add_directive_to_domainr   r	   )apps    r8   r   r      s!    l4FGGGrB   )r+   
__future__r   logging	getLoggerr:   logr   r,   r"   docutils.parsers.rst.directivesr   sphinx.errorsr   bokeh.core.property._sphinxr   bokeh.util.warningsr   r   r	   bokeh_directiver
   	templatesr   __all__r   r   rA   rB   r8   <module>rR      s.  % %T # " " " " " g!!       6 5 5 5 5 5 % % % % % % 2 1 1 1 1 1 7 7 7 7 7 7       + + + + + + " " " " " "*4 *4 *4 *4 *4 *4 *4 *4Z    rB   