slideception

Slideception lets you give interactive presentations in the terminal. Slides are defined as Python functions, so you can run arbitrary code to generate content for your slides. You could even go so far as to run another presentation from within one of your slides!

Requirements

Usage

Here's a quick example:

#!/usr/bin/env python3
from slideception import display_slides, ipython, slide

@slide
def context_managers():
    """Context Managers

    A **context manager** is a thing that can be used in a `with` block.

    ```python3
    with record_time() as timer:
        stuff()
    print(f"stuff took {timer.elapsed} seconds")
    ```

    It lets you factor out pieces of code that *surround* other code.
    """
    # Now jump into an intepreter for a quick demo
    ipython()


display_slides()

Presentation Boilerplate

At a minimum, you'll need to import display_slides and slide and call display_slides() at the bottom of your script.

#!/usr/bin/env python3
from slideception import display_slides, slide

…

display_slides()

Defining Slides

@slide

This decorator registers a function as a slide. The docstring of the function becomes the slide's content, and the body of the function is executed after the content is displayed. The docstring is parsed as CommonMark and then rendered for display in a terminal.

Helpers