U
    öÕ/eê  ã                   @  sÂ   d Z ddlmZ ddlZe e¡ZddlmZm	Z	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„ de
ƒZG dd„ de
ƒZG dd„ deƒZG dd„ de	ƒZdd„ ZdS )aq   Integrate Bokeh extensions into Sphinx autodoc.

Ensures that autodoc directives such as ``autoclass`` automatically make use of
Bokeh-specific directives when appropriate. The following Bokeh extensions are
configured:

* :ref:`bokeh.sphinxext.bokeh_color`
* :ref:`bokeh.sphinxext.bokeh_enum`
* :ref:`bokeh.sphinxext.bokeh_model`
* :ref:`bokeh.sphinxext.bokeh_prop`

é    )ÚannotationsN)ÚAttributeDocumenterÚClassDocumenterÚModuleLevelDocumenter)ÚColor)ÚEnumeration)ÚPropertyDescriptor)ÚModelé   )ÚPARALLEL_SAFE)ÚColorDocumenterÚEnumDocumenterÚModelDocumenterÚPropDocumenterÚsetupc                   @  s6   e Zd ZdZdZdZedd„ ƒZddd„Zd	d
„ Z	dS )r   zbokeh-colorÚ é   c                 C  s
   t |tƒS ©N)Ú
isinstancer   ©ÚclsÚmemberZ
membernameZisattrÚparent© r   úA/tmp/pip-unpacked-wheel-f5fndrjf/bokeh/sphinxext/bokeh_autodoc.pyÚcan_document_memberG   s    z#ColorDocumenter.can_document_memberFc                 C  s   d S r   r   )ÚselfZmore_contentZno_docstringr   r   r   Úadd_contentL   s    zColorDocumenter.add_contentc                 C  s   dg fS )NFr   )r   Zwant_allr   r   r   Úget_object_membersO   s    z"ColorDocumenter.get_object_membersN)F)
Ú__name__Ú
__module__Ú__qualname__ÚdirectivetypeÚobjtypeÚpriorityÚclassmethodr   r   r   r   r   r   r   r   B   s   

r   c                   @  s$   e Zd ZdZdZdZedd„ ƒZdS )r   z
bokeh-enumÚenumr   c                 C  s
   t |tƒS r   )r   r   r   r   r   r   r   X   s    z"EnumDocumenter.can_document_memberN©r   r    r!   r"   r#   r$   r%   r   r   r   r   r   r   S   s
   r   c                   @  s(   e Zd ZdZdZdZdZedd„ ƒZdS )r   z
bokeh-propÚpropr   iœÿÿÿc                 C  s
   t |tƒS r   )r   r   r   r   r   r   r   c   s    z"PropDocumenter.can_document_memberN)	r   r    r!   r"   r#   r$   Zmember_orderr%   r   r   r   r   r   r   ]   s   r   c                   @  s$   e Zd ZdZdZdZedd„ ƒZdS )r   zbokeh-modelÚmodelr   c                 C  s   t |tƒot|tƒS r   )r   ÚtypeÚ
issubclassr	   r   r   r   r   r   m   s    z#ModelDocumenter.can_document_memberNr'   r   r   r   r   r   h   s
   r   c                 C  s,   |   t¡ |   t¡ |   t¡ |   t¡ tS )z+ Required Sphinx extension setup function. )Zadd_autodocumenterr   r   r   r   r   )Zappr   r   r   r   r   s
    



r   )Ú__doc__Ú
__future__r   ÚloggingÚ	getLoggerr   ÚlogZsphinx.ext.autodocr   r   r   Zbokeh.colors.colorr   Zbokeh.core.enumsr   Zbokeh.core.property.descriptorsr   Zbokeh.modelr	   r   r   Ú__all__r   r   r   r   r   r   r   r   r   Ú<module>   s   


