{ "cells": [ { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" }, "toc": "true" }, "source": [ "

Table of Contents

\n", "
" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "# Demo of RISE for slides with Jupyter notebooks (Python)\n", "\n", "- This document is an example of a slideshow, written in a [Jupyter notebook](https://www.jupyter.org/) with the [RISE extension](https://github.com/damianavila/RISE).\n", "\n", "> By [Lilian Besson](http://perso.crans.org/besson/), Sept.2017." ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "---\n", "## Title 2\n", "### Title 3\n", "#### Title 4\n", "##### Title 5\n", "##### Title 6" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "## Text\n", "With text, *emphasis*, **bold**, ~~striked~~, `inline code` and\n", "\n", "> *Quote.*\n", ">\n", "> -- By a guy." ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "## Maths\n", "With inline math $\\sin(x)^2 + \\cos(x)^2 = 1$ and equations:\n", "$$\\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.$$" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "## And code\n", "In Markdown:\n", "```python\n", "Sys.command \"ocaml -version\";;\n", "```\n", "\n", "And in a executable cell (with OCaml 4.04.2 kernel) :" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "ExecuteTime": { "end_time": "2021-02-16T05:08:18.070800Z", "start_time": "2021-02-16T05:08:18.055Z" }, "slideshow": { "slide_type": "-" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "The OCaml toplevel, version 4.05.0\n" ] }, { "data": { "text/plain": [ "- : int = 0\n" ] }, "execution_count": 1, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Sys.command \"ocaml -version\";;" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "# More demo of Markdown code" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "## Lists\n", "\n", "- Unordered\n", "- lists\n", "- are easy.\n", "\n", "And\n", "\n", "1. and ordered also ! Just\n", "2. start lines by `1.`, `2.` etc\n", "3. or simply `1.`, `1.`, ..." ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "#### Images\n", "With a HTML `` tag or the `![alt](url)` Markdown code:\n", "\n", "\n", "![agreg/images/dooku.jpg](agreg/images/dooku.jpg)" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "Avec [l'ancienne API de ocaml-jupyter](https://akabe.github.io/ocaml-jupyter/notebook/JupyterNotebook.html) (pré 2020) :" ] }, { "cell_type": "code", "execution_count": 8, "metadata": { "ExecuteTime": { "end_time": "2021-02-16T05:10:31.766300Z", "start_time": "2021-02-16T05:10:31.744Z" } }, "outputs": [ { "ename": "error", "evalue": "compile_error", "output_type": "error", "traceback": [ "\u001b[32mFile \"[8]\", line 5, characters 24-47:\n\u001b[31mError: Unbound module JupyterNotebook\nHint: Did you mean Jupyter_notebook?\n\u001b[36m 4: \u001b[30m\n\u001b[36m 5: \u001b[30mlet youtube_video url = \u001b[4mJupyterNotebook.display\u001b[0m\u001b[30m \"text/html\"\n\u001b[36m 6: \u001b[30m (Printf.sprintf \"\" url)\u001b[0m\n" ] } ], "source": [ "#thread ;;\n", "#require \"jupyter.notebook\" ;;\n", "(* https://akabe.github.io/ocaml-jupyter/notebook/JupyterNotebook.html *)\n", "\n", "let youtube_video url = JupyterNotebook.display \"text/html\"\n", " (Printf.sprintf \"\" url)\n", ";;" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "Avec [la nouvelle API de ocaml-jupyter](https://akabe.github.io/ocaml-jupyter/api/jupyter/Jupyter_notebook/) (après 2020) :" ] }, { "cell_type": "code", "execution_count": 9, "metadata": { "ExecuteTime": { "end_time": "2021-02-16T05:10:35.842500Z", "start_time": "2021-02-16T05:10:35.832Z" } }, "outputs": [ { "data": { "text/plain": [ "val youtube_video : string -> Jupyter_notebook.display_id = \n" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "#thread ;;\n", "#require \"jupyter\" ;;\n", "#require \"jupyter.notebook\" ;;\n", "(* https://akabe.github.io/ocaml-jupyter/api/jupyter/Jupyter_notebook/ *)\n", "\n", "let youtube_video url = Jupyter_notebook.display \"text/html\"\n", " (Printf.sprintf \"\" url)\n", ";;" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "#### And Markdown can include raw HTML\n", "\n", "
This is a centered span, colored in green.
\n", "\n", "Iframes are disabled by default, but by using the IPython internals we can include let say a YouTube video:" ] }, { "cell_type": "code", "execution_count": 10, "metadata": { "ExecuteTime": { "end_time": "2021-02-16T05:10:37.923400Z", "start_time": "2021-02-16T05:10:37.915Z" }, "scrolled": false }, "outputs": [ { "data": { "text/html": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "- : Jupyter_notebook.display_id = \n" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "youtube_video \"https://www.youtube.com/embed/FNg5_2UUCNU\";;" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "Et depuis Markdown :\n", "" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "# End of this demo\n", "\n", "- See [here for more notebooks](https://github.com/Naereen/notebooks/)!\n", "- This document, like my other notebooks, is distributed [under the MIT License](https://lbesson.mit-license.org/)." ] } ], "metadata": { "celltoolbar": "Diaporama", "kernelspec": { "display_name": "OCaml 4.05.0", "language": "OCaml", "name": "ocaml-jupyter" }, "language_info": { "codemirror_mode": "text/x-ocaml", "file_extension": ".ml", "mimetype": "text/x-ocaml", "name": "OCaml", "nbconverter_exporter": null, "pygments_lexer": "OCaml", "version": "4.05.0" }, "toc": { "base_numbering": 1, "nav_menu": { "height": "129px", "width": "251px" }, "number_sections": true, "sideBar": true, "skip_h1_title": false, "title_cell": "Table of Contents", "title_sidebar": "Contents", "toc_cell": true, "toc_position": {}, "toc_section_display": "block", "toc_window_display": false }, "varInspector": { "cols": { "lenName": 16, "lenType": 16, "lenVar": 40 }, "kernels_config": { "python": { "delete_cmd_postfix": "", "delete_cmd_prefix": "del ", "library": "var_list.py", "varRefreshCmd": "print(var_dic_list())" }, "r": { "delete_cmd_postfix": ") ", "delete_cmd_prefix": "rm(", "library": "var_list.r", "varRefreshCmd": "cat(var_dic_list()) " } }, "types_to_exclude": [ "module", "function", "builtin_function_or_method", "instance", "_Feature" ], "window_display": false } }, "nbformat": 4, "nbformat_minor": 2 }