{
"cells": [
{
"cell_type": "markdown",
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"source": [
"# RISE Slideshow of a Jupyter Notebook"
]
},
{
"cell_type": "markdown",
"metadata": {
"editable": true,
"slideshow": {
"slide_type": "-"
},
"tags": []
},
"source": [
"\n",
" \n"
]
},
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "skip"
},
"tags": []
},
"source": [
"Author: Monika Doerig\n",
"\n",
"Citation: \n",
"- Full documentation of the [RISE notebook extension](http://rise.readthedocs.io/)"
]
},
{
"cell_type": "markdown",
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"source": [
"Press `Space` to proceed."
]
},
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "slide"
},
"tags": [
"toc"
]
},
"source": [
"Before getting to the introduction and details of creating a slideshow, let's set up this notebook to run in Google Colab.\n",
"\n",
"Keep pressing `Space` to proceed. "
]
},
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"source": [
"## Setup Neurodesk"
]
},
{
"cell_type": "markdown",
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"source": [
"In code cells you press `Shift-Enter` (as usual) to evaluate your code and directly move to the next cell if it is already displayed. \n",
"Press `Ctrl-Enter` to run a command without direclty moving to the next cell. \n",
"\n",
"Press Shift-Enter to run the following command to set up the Neurodesk environment."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": [],
"vscode": {
"languageId": "plaintext"
}
},
"outputs": [],
"source": [
"%%capture\n",
"import os\n",
"import sys\n",
"IN_COLAB = 'google.colab' in sys.modules\n",
"\n",
"if IN_COLAB:\n",
" os.environ[\"LD_PRELOAD\"] = \"\";\n",
" os.environ[\"APPTAINER_BINDPATH\"] = \"/content,/tmp,/cvmfs\"\n",
" os.environ[\"MPLCONFIGDIR\"] = \"/content/matplotlib-mpldir\"\n",
" os.environ[\"LMOD_CMD\"] = \"/usr/share/lmod/lmod/libexec/lmod\"\n",
"\n",
" !curl -J -O https://raw.githubusercontent.com/NeuroDesk/neurocommand/main/googlecolab_setup.sh\n",
" !chmod +x googlecolab_setup.sh\n",
" !./googlecolab_setup.sh\n",
"\n",
" os.environ[\"MODULEPATH\"] = ':'.join(map(str, list(map(lambda x: os.path.join(os.path.abspath('/cvmfs/neurodesk.ardc.edu.au/neurodesk-modules/'), x),os.listdir('/cvmfs/neurodesk.ardc.edu.au/neurodesk-modules/')))))"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"outputs": [],
"source": [
"# Press Ctrl-Enter to run the following commands to see the output (and not move directly to the next slide).\n",
"\n",
"# Output CPU information:\n",
"!cat /proc/cpuinfo | grep 'vendor' | uniq\n",
"!cat /proc/cpuinfo | grep 'model name' | uniq"
]
},
{
"cell_type": "markdown",
"metadata": {
"editable": true,
"slideshow": {
"slide_type": "slide"
},
"tags": [
"rise"
]
},
"source": [
"## Introduction to RISE\n",
"\n",
"RISE is Jupyter notebook slideshow extension that allows you to turn a Jupyter notebook into a live presentation based on [reveal.js](https://revealjs.com/). The full documentation can be found [here](http://rise.readthedocs.io/).\n",
"\n",
"Keep pressing `Space` to proceed along the main line.\n"
]
},
{
"cell_type": "markdown",
"metadata": {
"editable": true,
"slideshow": {
"slide_type": "slide"
},
"tags": []
},
"source": [
"### 1. How to create slideshows"
]
},
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": ""
},
"tags": []
},
"source": [
"Open or create a new Notebook (File > New > Notebook) in JupyterLab. Navigate to the `View` option in the menu and select `Property Inspector` (Ctrl+Shift+U). Alternatively, directly click on the gears icon to access cell and notebook metadata (on the left or right sidebar): \n"
]
},
{
"cell_type": "markdown",
"metadata": {
"editable": true,
"raw_mimetype": "",
"slideshow": {
"slide_type": ""
},
"tags": []
},
"source": [
"*You should be able to scroll down if the entire image is not displayed.*\n",
"\n",
"\n",
""
]
},
{
"cell_type": "markdown",
"metadata": {
"editable": true,
"slideshow": {
"slide_type": "slide"
},
"tags": []
},
"source": [
"To prepare a slideshow, select a `Slide Type` for each cell from the dropdown menu. It can be chosen between the following types: \n",
"- __Slide:__ This cell is the beginning of a new slide. These slides run from left to right. \n",
"- __Subslide:__ This cell is the beginning of a new sub-slide, which is a new slide, but is displayed below the previous one and runs form top to bottom (instead of left to right): \n",
"- __Fragment:__ A cell marked as fragment will split the contents of one slide into pieces; a break is created inside the slide and will not show up until `Space` is pressed one more time to see it. \n",
"- __Skip:__ This cell is ignored altogether in reveal mode, it will not appear either in the main view, nor in the speaker view.\n",
"- __Notes:__ This cell is marked to be discarded from the main view, but is meant to appear in the speaker view."
]
},
{
"cell_type": "markdown",
"metadata": {
"editable": true,
"raw_mimetype": "",
"slideshow": {
"slide_type": "-"
},
"tags": []
},
"source": [
" "
]
},
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "slide"
},
"tags": []
},
"source": [
"### 2. Running slideshows in JupyterLab on Neurodesk\n",
"- Start the slideshow by pressing the button `Render the current notebook as Reveal Slideshow` or by pressing Alt+R.\n"
]
},
{
"cell_type": "markdown",
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"source": [
" "
]
},
{
"cell_type": "markdown",
"metadata": {
"editable": true,
"slideshow": {
"slide_type": "slide"
},
"tags": []
},
"source": [
"### Navigation\n",
"Using the `SpaceBar` primarily for moving forward and `Shift-SpaceBar` for backward navigation is strongly advised (or utilize the visual controller in the slideshow's bottom right corner). This method ensures smooth progression through the presentation, regardless of its detailed structure (slides, subslides, fragments...)."
]
},
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"source": [
"### Selection and evaluation\n",
"To evaluate code, press `Shift-Enter` (as usual) to run it. This will move to the next cell if it is already displayed."
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {
"slideshow": {
"slide_type": "-"
},
"tags": []
},
"outputs": [
{
"data": {
"text/plain": [
"(6,)"
]
},
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# this is where you press Shift-Enter\n",
"import numpy as np\n",
"\n",
"a = np.arange(6)\n",
"a.shape"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {
"editable": true,
"slideshow": {
"slide_type": "-"
},
"tags": []
},
"outputs": [
{
"data": {
"text/plain": [
"(1, 6)"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Press Ctrl-Enter to also see this output\n",
"a2 = a[np.newaxis, :]\n",
"a2.shape"
]
},
{
"cell_type": "markdown",
"metadata": {
"editable": true,
"slideshow": {
"slide_type": "slide"
},
"tags": [
"rise"
]
},
"source": [
"### Other notes\n",
"- Markdown Images get left aligned by default. Enclose the image like `