Skip to content

Instantly share code, notes, and snippets.

@pezcode
Last active June 16, 2018 13:32
Show Gist options
  • Save pezcode/5a91ad0ba18d8ed6d69ec9424f4b98d6 to your computer and use it in GitHub Desktop.
Save pezcode/5a91ad0ba18d8ed6d69ec9424f4b98d6 to your computer and use it in GitHub Desktop.
Export IPython Notebook to presentation slides (this is handy to do from within the notebook)
from nbconvert import SlidesExporter
from traitlets.config import Config
infile = "Notebook.ipynb"
outfile = "Presentation.html"
config = Config({
'SlidesExporter': {
'reveal_theme': 'serif',
'reveal_transition':'fade'
}
})
body, _ = SlidesExporter(config=config).from_filename(infile)
with open(outfile, "wb") as fp:
fp.write(body.encode('utf-8'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment