#!/usr/bin/env python
# coding: utf-8
# #### New to Plotly?
# Plotly's Python library is free and open source! [Get started](https://plotly.com/python/getting-started/) by downloading the client and [reading the primer](https://plotly.com/python/getting-started/).
#
You can set up Plotly to work in [online](https://plotly.com/python/getting-started/#initialization-for-online-plotting) or [offline](https://plotly.com/python/getting-started/#initialization-for-offline-plotting) mode, or in [jupyter notebooks](https://plotly.com/python/getting-started/#start-plotting-online).
#
We also have a quick-reference [cheatsheet](https://images.plot.ly/plotly-documentation/images/python_cheat_sheet.pdf) (new!) to help you get started!
# #### Version Check
# Note: The presentations API is available in version 2.2.1.+
# Run `pip install plotly --upgrade` to update your Plotly version.
# In[1]:
import plotly
plotly.__version__
# #### Plotly Presentations
# To use Plotly's Presentations API you will write your presentation code in a string of markdown and then pass that through the Presentations API function `pres.Presentation()`. This creates a JSON version of your presentation. To upload the presentation online pass it through `py.presentation_ops.upload()`.
#
# In your string, use `---` on a single line to seperate two slides. To put a title in your slide, put a line that starts with any number of `#`s. Only your first title will be appear in your slide. A title looks like:
#
# `# slide title`
#
# Anything that comes after the title will be put as text in your slide. Check out the example below to see this in action.
# #### Current Limitations
# `Boldface`, _italics_ and [hypertext](https://www.w3.org/WhatIs.html) are not supported features of the Presentation API.
# #### Display in Jupyter
# The function below generates HTML code to display the presentation in an iframe directly in Jupyter.
# In[3]:
def url_to_iframe(url, text=True):
html = ''
# style
html += '''
Click on the presentation above and use left/right arrow keys to flip through the slides.