
    f                     x    d Z ddlmZ ddlmZ ddlmZmZmZ ddl	m
Z
 ddlmZ  G d d	e
      Z G d
 de      Zy)zHTML slide show Exporter class    )deepcopy)warn)BoolUnicodedefault)Preprocessor   )HTMLExporterc                       e Zd ZddZy)_RevealMetadataPreprocessorNc                    t        |      }|j                  D ]@  }	 |j                  j                  di       j                  dd      }||j                  _        B t        |j                        D ]T  \  }}|j                  j
                  dvsd|j                  _        d|j                  _        d|j                  _        |} n d}t        |      d}t        |j                  |d	z   d  |d	z   
      D ]  \  }}|j                  |d	z
     }	|j                  j
                  dk(  r"d|	j                  _
        d|j                  _        |j                  j
                  dv r6||	j                  _        d|	j                  _        d|j                  _        d}|j                  j
                  dk(  sd|j                  _        |rd|	j                  _        d} ||j                  d   j                  _        d|j                  d   j                  _        d|j                  d   j                  _
        ||fS # t        $ r d}Y w xY w)N	slideshow
slide_type->   skipnotesslideTz-All cells are hidden, cannot create slideshowFr	   )start>   r   subslidefragment)r   cellsmetadatagetAttributeErrorr   	enumerateslide_startsubslide_start
ValueError	slide_endfragment_endsubslide_endfragment_start)
selfnb	resourcescellr   indexfirst_slide_ixmsgin_fragmentprevious_cells
             U/var/www/cvtools/html/venv/lib/python3.12/site-packages/nbconvert/exporters/slides.py
preprocessz&_RevealMetadataPreprocessor.preprocess   s   b\HH 	2D!!]]..{B?CCLRUV
 (2DMM$	2 %RXX. 		"KE4}}''/@@+2(,0)/3,!&		" BCS/!$RXXnq.@.B%CN]^L^` 	'KE4HHUQY/M }}''7237&&0,0)}}''+@@6A&&36:&&3/3,#))Z7/3,:>M**7"&K=	'B .9*-1**.'9}o " ! 
!s   ,H88II)N)__name__
__module____qualname__r.        r-   r   r      s    >r3   r   c                   4    e Zd ZdZdZ ed      d        Z ed      d        Z ed      d        Z e	d	
      j                  d      Z ed      d        Z e	dd
      j                  d      Z e	dd
      j                  d      Z edd
      j                  d      Z e	dd
      j                  d      Z e	dd
      j                  d      Z e	dd
      j                  d      Z e	dd
      j                  d      Z fdZ xZS )SlidesExporterz"Exports HTML slides with reveal.jszReveal.js slidestemplate_namec                      y)Nrevealr2   r$   s    r-   _template_name_defaultz%SlidesExporter._template_name_default[   s    r3   file_extensionc                      y)Nz.slides.htmlr2   r9   s    r-   _file_extension_defaultz&SlidesExporter._file_extension_default_   s    r3   template_extensionc                      y)Nz.html.j2r2   r9   s    r-   _template_extension_defaultz*SlidesExporter._template_extension_defaultc   s    r3   a,  The URL prefix for reveal.js (version 3.x).
        This defaults to the reveal CDN, but can be any url pointing to a copy
        of reveal.js.

        For speaker notes to work, this must be a relative path to a local
        copy of reveal.js: e.g., "reveal.js".

        If a relative path is given, it must be a subdirectory of the
        current directory (from which the server is run).

        See the usage documentation
        (https://nbconvert.readthedocs.io/en/latest/usage.html#reveal-js-html-slideshow)
        for more details.
        )helpT)configreveal_url_prefixc                 z    d| j                   v r-t        dd       | j                   j                  j                  S y)Nz!RevealHelpPreprocessor.url_prefixzdPlease update RevealHelpPreprocessor.url_prefix to SlidesExporter.reveal_url_prefix in config files.   )
stacklevelz!https://unpkg.com/reveal.js@4.0.2)rB   r   RevealHelpPreprocessor
url_prefixr9   s    r-   _reveal_url_prefix_defaultz)SlidesExporter._reveal_url_prefix_defaultz   s:    .$++=D
 ;;55@@@2r3   simplea(  
        Name of the reveal.js theme to use.

        We look for a file with this name under
        ``reveal_url_prefix``/css/theme/``reveal_theme``.css.

        https://github.com/hakimel/reveal.js/tree/master/css/theme has
        list of themes that ship by default with reveal.js.
        r   z
        Name of the reveal.js transition to use.

        The list of transitions that ships by default with reveal.js are:
        none, fade, slide, convex, concave and zoom.
        Fz=
        If True, enable scrolling within each slide
         z
        slide number format (e.g. 'c/t'). Choose from:
        'c': current, 't': total, 'h': horizontal, 'v': vertical
        z
        width used to determine the aspect ratio of your presentation.
        Use the horizontal pixels available on your intended presentation
        equipment.
        z
        height used to determine the aspect ratio of your presentation.
        Use the horizontal pixels available on your intended presentation
        equipment.
        zNhttps://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.csszY
        URL to load font awesome from.

        Defaults to loading from cdnjs.
        c                 4   t         |   |      }d|vri |d<   | j                  |d   d<   | j                  |d   d<   | j                  |d   d<   | j
                  |d   d<   | j                  |d   d<   | j                  |d   d<   | j                  |d   d<   |S )	Nr8   rH   theme
transitionscrollnumberheightwidth)	super_init_resourcesrC   reveal_themereveal_transitionreveal_scrollreveal_numberreveal_heightreveal_width)r$   r&   	__class__s     r-   rT   zSlidesExporter._init_resources   s    G+I6	9$"$Ih,0,B,B	(L)'+'8'8	(G$,0,B,B	(L)(,(:(:	(H%(,(:(:	(H%(,(:(:	(H%'+'8'8	(G$r3   )r/   r0   r1   __doc__export_from_notebookr   r:   r=   r@   r   tagrC   rI   rU   rV   r   rW   rX   rZ   rY   font_awesome_urlrT   __classcell__)r[   s   @r-   r5   r5   T   s   , ._    !" #
   
cc "  !3 "3  
cc    
cc  
 
cc  
 
cc  
 
cc  
 
cc  X 
cc  r3   r5   N)r\   copyr   warningsr   	traitletsr   r   r   nbconvert.preprocessors.baser   htmlr
   r   r5   r2   r3   r-   <module>rf      s9    $
   , , 5 A, AH}\ }r3   