Demo of RISE for slides with Jupyter notebooks (Python)

By Lilian Besson, Sept.2017.


Title 2

Title 3

Title 4

Title 5
Title 6

Text

With text, emphasis, bold, striked, inline code and

Quote.

-- By a guy.

Maths

With inline math $\sin(x)^2 + \cos(x)^2 = 1$ and equations: $$\sin(x)^2 + \cos(x)^2 = \left(\frac{\mathrm{e}^{ix} - \mathrm{e}^{-ix}}{2i}\right)^2 + \left(\frac{\mathrm{e}^{ix} + \mathrm{e}^{-ix}}{2}\right)^2 = \frac{-\mathrm{e}^{2ix}-\mathrm{e}^{-2ix}+2 \; ++\mathrm{e}^{2ix}+\mathrm{e}^{-2ix}+2}{4} = 1.$$

And code

In Markdown:

Sys.command "ocaml -version";;

And in a executable cell (with OCaml 4.04.2 kernel) :

In [1]:
Sys.command "ocaml -version";;
The OCaml toplevel, version 4.05.0
Out[1]:
- : int = 0

More demo of Markdown code

Lists

  • Unordered
  • lists
  • are easy.

And

  1. and ordered also ! Just
  2. start lines by 1., 2. etc
  3. or simply 1., 1., ...

Images

With a HTML <img/> tag or the ![alt](url) Markdown code:

agreg/images/dooku.jpg

Avec l'ancienne API de ocaml-jupyter (pré 2020) :

In [8]:
#thread ;;
#require "jupyter.notebook" ;;
(* https://akabe.github.io/ocaml-jupyter/notebook/JupyterNotebook.html *)

let youtube_video url = JupyterNotebook.display "text/html"
    (Printf.sprintf "<iframe width=560 height=315 src='%s'></iframe>" url)
;;
File "[8]", line 5, characters 24-47:
Error: Unbound module JupyterNotebook
Hint: Did you mean Jupyter_notebook?
   4: 
   5: let youtube_video url = JupyterNotebook.display "text/html"
   6:     (Printf.sprintf "<iframe width=560 height=315 src='%s'></iframe>" url)

Avec la nouvelle API de ocaml-jupyter (après 2020) :

In [9]:
#thread ;;
#require "jupyter" ;;
#require "jupyter.notebook" ;;
(* https://akabe.github.io/ocaml-jupyter/api/jupyter/Jupyter_notebook/ *)

let youtube_video url = Jupyter_notebook.display "text/html"
    (Printf.sprintf "<iframe width=560 height=315 src='%s'></iframe>" url)
;;
Out[9]:
val youtube_video : string -> Jupyter_notebook.display_id = <fun>

And Markdown can include raw HTML

This is a centered span, colored in green.

Iframes are disabled by default, but by using the IPython internals we can include let say a YouTube video:

In [10]:
youtube_video "https://www.youtube.com/embed/FNg5_2UUCNU";;
Out[10]:
- : Jupyter_notebook.display_id = <abstr>

Et depuis Markdown :

End of this demo