How to export Jupyter slides with hidden code

At the beginning of the notebook, create a new code cell with the following:

from IPython.display import HTML
function code_toggle() {
 if (code_show){
 } else {
 code_show = !code_show
$( document ).ready(code_toggle);
The raw code for this IPython notebook is by default hidden for easier reading.
To toggle on/off the raw code, click <a href="javascript:code_toggle()">here</a>.''')

Choose “Notes” as slide type and execute it. The output of this cell allows to toggle on/off the raw code.

Download the notebook as “Reveal.js slides” while the raw code is hidden and it will not appear in the slides.