
    Mh                     r    d dl Z d dlmZmZmZmZmZmZmZ d dl	m
Z
 d dlmZ d dlmZ  G d de          ZdS )    N)	HasTraitsDictUnicodeListBoolobservedefault)jupyter_path)_i18n)url_path_joinc                   R    e Zd Z edd ed                    Z ed ed                    Z ed ed                    Z eddd          Z	 e
d          d	             Z e e            dd
          Zed             Z e e             ed                    Z ed          d             Z e e            d ed                    Zed             Z e e            d ed                    Zed             Z eddd          Ze fd            Z ed          d             Z e
d          d             Z edd ed                    Z e
d          d             Z eddd          Z ei d ed                    Z xZ S ) NotebookAppTraitsFTzXDeprecated: Use minified JS file or not, mainly use during dev to avoid JS recompilation)confighelpz@Supply extra arguments that will be passed to Jinja environment.z<Extra variables to supply to jinja templates when rendering.ak  Whether to enable MathJax for typesetting math/TeX

        MathJax is the javascript library Jupyter uses to render math/LaTeX. It is
        very large, so you may want to disable it if you have a slow internet
        connection, or for offline use of the notebook.

        When disabled, equations etc. will appear as their untransformed TeX source.
        enable_mathjaxc                 (    |d         s	d| _         dS dS )z/set mathjax url to empty if mathjax is disablednew N)mathjax_urlselfchanges     T/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/notebook_shim/traits.py_update_enable_mathjaxz(NotebookAppTraits._update_enable_mathjax'   s(     e} 	#"D	# 	#    zExtra paths to search for serving static files.

        This allows adding javascript/css to be available from the notebook server machine,
        or overriding individual files in the IPythonc                     | j         S )z)return extra paths + the default location)extra_static_pathsr   s    r   static_file_pathz"NotebookAppTraits.static_file_path4   s     &&r   z!Path to search for custom.js, css)r   static_custom_pathc                 N    t           j                            | j        d          gS )Ncustom)ospathjoin
config_dirr   s    r   _default_static_custom_pathz-NotebookAppTraits._default_static_custom_path>   s#     GLL(33
 	
r   zvExtra paths to search for serving jinja templates.

        Can be used to override templates from notebook.templates.c                     | j         S )z*return extra paths + the default locations)extra_template_pathsr   s    r   template_file_pathz$NotebookAppTraits.template_file_pathJ   s     ((r   z6extra paths to look for Javascript notebook extensionsc                     | j         t          d          z   }	 ddlm} |                    t
          j                             |            d                     n# t          $ r Y nw xY w|S )z3The path to look for Javascript notebook extensionsnbextensionsr   )get_ipython_dir)	extra_nbextensions_pathr
   IPython.pathsr-   appendr#   r$   r%   ImportError)r   r$   r-   s      r   nbextensions_pathz#NotebookAppTraits.nbextensions_pathT   s     +l>.J.JJ	I555555 KK__%6%6GGHHHH  	 	 	D	 s   A 
A('A(r   zA custom url for MathJax.js.
        Should be in the form of a case-sensitive url to MathJax,
        for example:  /static/components/MathJax/MathJax.js
        c                 8    t          t          |           j        S )z3Get the static url prefix for serving static files.)superr   static_url_prefix)r   	__class__s    r   r5   z#NotebookAppTraits.static_url_prefixh   s     &--??r   r   c                 F    | j         sdS | j        }t          |ddd          S )Nr   
componentsMathJaxz
MathJax.js)r   r5   r   )r   r5   s     r   _default_mathjax_urlz&NotebookAppTraits._default_mathjax_urlm   s0    " 	3 2.iVVVr   c                     |d         }|r| j         s	d| _        d S | j                            t	          d          |           d S )Nr   r   zUsing MathJax: %s)r   r   loginfor   )r   r   r   s      r   _update_mathjax_urlz%NotebookAppTraits._update_mathjax_urlt   sP    Um 	;t* 	;"DHMM% 344c:::::r   zTeX-AMS-MML_HTMLorMML-full,Safez5The MathJax.js configuration file that is to be used.mathjax_configc                 b    | j                             t          d          |d                    d S )Nz$Using MathJax configuration file: %sr   )r<   r=   r   r   s     r   _update_mathjax_configz(NotebookAppTraits._update_mathjax_config   s;    8996%=	J 	J 	J 	J 	Jr   zZIf True, display a button in the dashboard to quit
        (shutdown the notebook server).zDict of Python modules to load as notebook server extensions.Entry values can be used to enable and disable the loading ofthe extensions. The extensions will be loaded in alphabetical order.)!__name__
__module____qualname__r   r   ignore_minified_jsr   jinja_environment_optionsjinja_template_varsr   r   r   r   r   r   propertyr   r    r	   r'   r)   r*   r.   r2   r   r5   r:   r>   r?   rA   quit_buttonnbserver_extensions__classcell__)r6   s   @r   r   r      sx       e%)#(5"|$~ $~      !%D*/%0r*s*s!u !u !u $UJL L   T$t 	 	 	N W# # #
 ggii$9      ' ' X' ggii#(5"I$K $K     
 W!""
 
 #"

  4		$%*U ,F &G &G" " " ) ) X) #d7799T(-'c)e )e% % %
 
 
 X
 '"T   K @ @ @ @ X@ W]W W W W]; ; ; W>t"'%!\#^ #^  N
 WJ J J $tD+  K
 $r$%*U ,4 &5 &5! ! !r   r   )r#   	traitletsr   r   r   r   r   r   r	   jupyter_core.pathsr
   jupyter_server.transutilsr   jupyter_server.utilsr   r    r   r   <module>rQ      s    				                  , + + + + + + + + + + + . . . . . .F! F! F! F! F!	 F! F! F! F! F!r   