
    f:                     h    d Z ddlmZmZmZmZmZmZ ddlm	Z	m
Z
mZ ddlmZ e
 G d de	             Zy)z!Simple magics for display formats    )display
JavascriptLatexSVGHTMLMarkdown)Magicsmagics_class
cell_magic)magic_argumentsc                       e Zd ZdZed        Zed        Zed        Zed        Z e	j                          e	j                  dddd	
      ed                      Zed        Zy)DisplayMagicszMagics for displaying various output types with literals

    Defines javascript/latex/svg/html cell magics for writing
    blocks in those languages, to be rendered in the frontend.
    c                 (    | j                  ||       y)a  Run the cell block of Javascript code

        Alias of `%%javascript`

        Starting with IPython 8.0 %%javascript is pending deprecation to be replaced
        by a more flexible system

        Please See https://github.com/ipython/ipython/issues/13376
        N)
javascriptselflinecells      V/var/www/cvtools/html/venv/lib/python3.12/site-packages/IPython/core/magics/display.pyjszDisplayMagics.js"   s     	d#    c                 ,    t        t        |             y)zRun the cell block of Javascript code

        Starting with IPython 8.0 %%javascript is pending deprecation to be replaced
        by a more flexible system

        Please See https://github.com/ipython/ipython/issues/13376
        N)r   r   r   s      r   r   zDisplayMagics.javascript/   s     	
4 !r   c                 ,    t        t        |             y)a+  Render the cell as a block of LaTeX

        The subset of LaTeX which is supported depends on the implementation in
        the client.  In the Jupyter Notebook, this magic only renders the subset
        of LaTeX defined by MathJax
        [here](https://docs.mathjax.org/en/v2.5-latest/tex.html).N)r   r   r   s      r   latexzDisplayMagics.latex;   s     	dr   c                 ,    t        t        |             y)z!Render the cell as an SVG literalN)r   r   r   s      r   svgzDisplayMagics.svgE   s     	D	r   z
--isolated
store_trueFzZAnnotate the cell as 'isolated'.
Isolated cells are rendered inside their own <iframe> tag)actiondefaulthelpc                     t        j                  | j                  |      }t        |      }|j                  rt        |dddii       yt        |       y)z"Render the cell as a block of HTMLz	text/htmlisolatedT)metadataN)r   parse_argstringhtmlr   r"   r   )r   r   r   argsr%   s        r   r%   zDisplayMagics.htmlJ   sE     ..tyy$?Dz==DKD0A#BCDMr   c                 ,    t        t        |             y)z&Render the cell as Markdown text blockN)r   r   r   s      r   markdownzDisplayMagics.markdownZ   s     	r   N)__name__
__module____qualname____doc__r   r   r   r   r   r   argumentr%   r(    r   r   r   r      s     
$ 
$ " "     %_$$&_\5=
   '    r   r   N)r,   IPython.displayr   r   r   r   r   r   IPython.core.magicr	   r
   r   IPython.corer   r   r.   r   r   <module>r2      s>    ' L K  ) B F B  B r   