from IPython.display import YouTubeVideo
YouTubeVideo('F4rFuIb1Ie4')

"""
Explanation: Go down for licence and other metadata about this presentation
Licence
Unless stated otherwise all content is released under a [CC0]+BY licence. I'd appreciate it if you reference this but it is not necessary.

Using Ipython for presentations
I've created a short video showing how to use Ipython for presentations
End of explanation
"""


%install_ext https://raw.githubusercontent.com/rasbt/python_reference/master/ipython_magic/watermark.py
%load_ext watermark


%watermark -a "Anthony Beck"  -d -v -m -g

#List of installed conda packages
!conda list

#List of installed pip packages
!pip list

"""
Explanation: Key activities

Inline things
Exporting
as html5
static - and locally served: - !ipython nbconvert Template.ipynb --to slides --post serve
SPEAKER NOTES work in the above


static - !ipython nbconvert Template.ipynb --to slides


as pdf


hosting:
on slideshare
I believe I should use the pdf
what about slideviewer[http://slideviewer.herokuapp.com/]


on github:
just create a git project with these presentations in them :-)





PDF output - hack from Damian

cd in the directory where your slideshow lives
add this custom.css file: https://gist.github.com/damianavila/6211198
run this little snippet: https://gist.github.com/damianavila/6211211
run python -m SimpleHTTPServer 8001
open Mozilla Firefox browser and point to localhost:8001
add ?print.pdf to the end of the url (ie, http://127.0.0.1:8001/your-ipynb.slides.html?print-pdf)
print to pdf (use Landscape orientation)

The environment
In order to replicate my environment you need to know what I have installed!
Set up watermark
This describes the versions of software used during the creation. 
Please note that critical libraries can also be watermarked as follows:
python
%watermark -v -m -p numpy,scipy
End of explanation
"""


!ipython nbconvert Template.ipynb --to slides --post serve

"""
Explanation: Background
You need to install the RISE Ipython Library from Damián Avila for dynamic presentations
To convert and run this as a static presentation run the following command:
End of explanation
"""


#Future proof python 2
from __future__ import print_function #For python3 print syntax
from __future__ import division

# def
import IPython.core.display

# A function to collect user input - ipynb_input(varname='username', prompt='What is your username')

def ipynb_input(varname, prompt=''):
        """Prompt user for input and assign string val to given variable name."""
        js_code = ("""
            var value = prompt("{prompt}","");
            var py_code = "{varname} = '" + value + "'";
            IPython.notebook.kernel.execute(py_code);
        """).format(prompt=prompt, varname=varname)
        return IPython.core.display.Javascript(js_code)
    
# inline

%pylab inline

"""
Explanation: To close this instances press control 'c' in the ipython notebook terminal console
Static presentations allow the presenter to see speakers notes (use the 's' key)
If running dynamically run the scripts below
Pre load some useful libraries
End of explanation
"""


