
    Mh                     J    d Z ddlZddlmZmZ ddlmZ  G d de          ZdS )zNotebookExporter class    N)Enumdefault   )Exporterc                        e Zd ZdZ e eej                  ej        d          	                    d          Z
 ed          d             ZdZd	Zd fd	Z xZS )NotebookExporterzExports to an IPython notebook.

    This is useful when you want to use nbconvert's preprocessors to operate on
    a notebook (e.g. to execute it) and then write it back to a notebook file.
    zPThe nbformat version to write.
        Use this to downgrade notebooks.
        )default_valuehelpT)configfile_extensionc                     dS )Nz.ipynb )selfs    \/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/nbconvert/exporters/notebook.py_file_extension_defaultz(NotebookExporter._file_extension_default   s    x    zapplication/jsonNotebookNc                      t                      j        ||fi |\  }}| j        |j        k    rd| j        z  |d<   nd|d<   t          j        || j                  }|                    d          s|dz   }||fS )zConvert from notebook node.z.v%ioutput_suffixz
.nbconvert)version
)superfrom_notebook_nodenbformat_versionnbformatwritesendswith)r   nb	resourceskwnb_copyoutput	__class__s         r   r   z#NotebookExporter.from_notebook_node"   s    7UWW7ILLLL G$444)/$2G)GIo&&)5Io&$2GHHHt$$ 	#d]Fy  r   )N)__name__
__module____qualname____doc__r   listr   versionscurrent_nbformattagr   r   r   output_mimetypeexport_from_notebookr   __classcell__)r#   s   @r   r   r      s          tX/   
cc  W   )O%
! 
! 
! 
! 
! 
! 
! 
! 
! 
!r   r   )r'   r   	traitletsr   r   exporterr   r   r   r   r   <module>r1      st     
  # # # # # # # #       !  !  !  !  !x  !  !  !  !  !r   