o
    i                     @   s<   d Z ddlZddlmZmZ ddlmZ G dd deZdS )zNotebookExporter class    N)Enumdefault   )Exporterc                       sX   e Zd ZdZeeejejddj	ddZ
eddd Zd	Zd
Zd fdd	Z  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                 C   s   dS )Nz.ipynb )selfr   r   W/var/www/edux/Edux_v2/venv/lib/python3.10/site-packages/nbconvert/exporters/notebook.py_file_extension_default   s   z(NotebookExporter._file_extension_defaultzapplication/jsonNotebookNc                    sh   t  j||fi |\}}| j|jkrd| j |d< nd|d< tj|| jd}|ds0|d }||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__r   r   r   "   s   
z#NotebookExporter.from_notebook_node)N)__name__
__module____qualname____doc__r   listr   versionscurrent_nbformattagr   r   r   output_mimetypeexport_from_notebookr   __classcell__r   r   r   r   r      s    
r   )r#   r   	traitletsr   r   exporterr   r   r   r   r   r   <module>   s
    