This module defines the text user interface (TUI) for lookatme
Perform the actual rendering of a slide. This is done by:
- parsing the slide into tokens (should have occurred already)
- iterating through each parsed markdown token
- calling the appropriately-named render function for the
Each render function must have the signature:
def render_XXX(token, body, stack, loop): pass
The arguments to the render function are described below:
token- the lexed markdown token - a dictionary
body- the current
urwid.Pile()that return values will be added to (same as
stack- The stack of
urwid.Pile()used during rendering. E.g., when rendering nested lists, each nested list will push a new
urwid.Pile()to the stack, each wrapped with its own additional indentation.
urwid.MainLoopinstance being used by lookatme. This won’t usually be used, but is available if needed.
Main render functions (those defined in markdown_block.py) may have three types of return values:
None- nothing is added to
stack[-1]. Perhaps the render function only needed to add additional indentation by pushing a new
urwid.Pile()to the stack.
list(urwid.Widget)- A list of widgets to render. These will automatically be added to the Pile at
urwid.Widget- A single widget to render. Will be added to
Render a slide, blocking until the slide completes. If
forceis True, rerender the slide even if it is in the cache.
Run the provided presentation
Parameters: start_slide (int) – 0-based slide index