B
    \8                 @   s   d Z ddlZddlmZ ddlmZ ddl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 G dd deZi g fddZdd Zdd Zdd Zdd ZdS )z
    sphinx.ext.mathbase
    ~~~~~~~~~~~~~~~~~~~

    Set up math support in source files and LaTeX/text output.

    :copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS.
    :license: BSD, see LICENSE for details.
    N)nodes)	math_role)math
math_block)math_reference)RemovedInSphinx30Warning)MathDirective)
MathDomain)MathReferenceRolec                   s   e Zd Z fddZ  ZS )r   c                s   t jdtdd tt|  S )NzPsphinx.ext.mathbase.MathDirective is moved to sphinx.directives.patches package.   )
stacklevel)warningswarnr   superr   run)self)	__class__ 2lib/python3.7/site-packages/sphinx/ext/mathbase.pyr       s    
zMathDirective.run)__name__
__module____qualname__r   __classcell__r   r   )r   r   r      s   r   c             C   s$   t jdtdd t| ||||||S )Nzisphinx.ext.mathbase.math_role() is deprecated. Please use docutils.parsers.rst.roles.math_role() instead.r   )r   )r   r   r   math_role_base)ZroleZrawtexttextlinenoZinlinerZoptionsZcontentr   r   r   r   '   s    
r   c             C   s&   t jdtdd ddlm} || |S )NzTsphinx.ext.mathbase.get_node_equation_number() is moved to sphinx.util.math package.r   )r   r   )get_node_equation_number)r   r   r   sphinx.util.mathr   )writernoder   r   r   r   r   .   s    
r   c             C   s(   t jdtdd ddlm} || ||S )NzLsphinx.ext.mathbase.wrap_displaymath() is moved to sphinx.util.math package.r   )r   r   )wrap_displaymath)r   r   r   r   r    )r   ZlabelZ	numberingr    r   r   r   r    7   s    
r    c             C   sP   ddl m} tjdtdd x.|| D ]"}t|tjr&t|jtj	r&dS q&W dS )z0Determine whether the node is in a section titler   )traverse_parentz$is_in_section_title() is deprecated.r   )r   TF)
Zsphinx.util.nodesr!   r   r   r   
isinstancer   titleparentZsection)r   r!   Zancestorr   r   r   is_in_section_title@   s    
r%   c             C   s"   t jdtdd | d|| d S )NzLsetup_math() is deprecated. Please use app.add_html_math_renderer() instead.r   )r   unknown)r   r   r   Zadd_html_math_renderer)ZappZhtmlinlinevisitorsZhtmldisplayvisitorsr   r   r   
setup_mathO   s    
r'   )__doc__r   Zdocutilsr   Zdocutils.parsers.rst.rolesr   r   Zsphinx.addnodesr   r   ZdisplaymathZsphinx.builders.latex.nodesr   ZeqrefZsphinx.deprecationr   Zsphinx.directives.patchesr   ZMathDirectiveBaseZsphinx.domains.mathr	   r
   Z
EqXRefRoler   r    r%   r'   r   r   r   r   <module>
   s   			