B
    @\                 @   sj   d Z ddlmZmZmZmZ ddlZeeZ	ddl
mZ ddlmZ ddlmZ dZG d	d
 d
eZdS )a_  
To generate a standalone HTML page for a Bokeh application from a single
Python script, pass the script name to ``bokeh html`` on the command
line:

.. code-block:: sh

    bokeh html app_script.py

The generated HTML will be saved in the current working directory with
the name ``app_script.html``.

It is also possible to run the same commmand with jupyter notebooks:

.. code-block:: sh

    bokeh html app_notebook.ipynb

This will generate an HTML file named ``app_notebook.html`` just like
with a python script.

Applications can also be created from directories. The directory should
contain a ``main.py`` (and any other helper modules that are required) as
well as any additional assets (e.g., theme files). Pass the directory name
to ``bokeh html`` to generate the HTML:

.. code-block:: sh

    bokeh html app_dir

It is possible to generate HTML pages for multiple applications at once:

.. code-block:: sh

    bokeh html app_script.py app_dir

If you would like to automatically open a browser to display the HTML
page(s), you can pass the ``--show`` option on the command line:

.. code-block:: sh

    bokeh html app_script.py app_dir --show

This will open two pages, for ``app_script.html`` and ``app_dir.html``,
respectively.

.. warning::
    Applications that use ``on_change`` callbacks require using the Bokeh
    server to execute the callback code.

    )absolute_importdivisionprint_functionunicode_literalsN)	Resources)	file_html   )FileOutputSubcommand)HTMLc               @   sN   e Zd ZdZdZdZdZed de	dddffe
  Zdd	 Zd
d ZdS )r
   zB Subcommand to output applications as standalone HTML files.

    Zhtmlz9Create standalone HTML files for one or more applicationsz--show
store_truez#Open generated file(s) in a browser)actionhelpc             C   s   |j rddlm} || dS )z


        r   )viewN)ZshowZbokeh.util.browserr   )selfargsfilenamedocr    r   =lib/python3.7/site-packages/bokeh/command/subcommands/html.pyafter_write_filev   s    zHTML.after_write_filec             C   s   t ddd}t||S )z


        ZcdnN)modeZroot_dir)r   r   )r   r   r   Z	resourcesr   r   r   file_contents~   s    zHTML.file_contentsN)__name__
__module____qualname____doc__name	extensionr   r	   Z	files_argdictZ
other_argsr   r   r   r   r   r   r   r
   ]   s   

r
   )r   Z
__future__r   r   r   r   ZloggingZ	getLoggerr   logZbokeh.resourcesr   Zbokeh.embedr   Zfile_outputr	   __all__r
   r   r   r   r   <module>9   s   
