You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
spiel/api/index.html

2102 lines
58 KiB
HTML

<!doctype html>
<html lang="en" class="no-js">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="canonical" href="https://www.spiel.how/api/">
<link rel="prev" href="../transitions/">
<link rel="next" href="../gallery/">
<link rel="icon" href="../assets/favicon.png">
<meta name="generator" content="mkdocs-1.5.3, mkdocs-material-9.4.4">
<title>API Reference - Spiel</title>
<link rel="stylesheet" href="../assets/stylesheets/main.bd3936ea.min.css">
<link rel="stylesheet" href="../assets/stylesheets/palette.356b1318.min.css">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,700,700i%7CRoboto+Mono:400,400i,700,700i&display=fallback">
<style>:root{--md-text-font:"Roboto";--md-code-font:"Roboto Mono"}</style>
<link rel="stylesheet" href="../assets/_mkdocstrings.css">
<link rel="stylesheet" href="../assets/style.css">
<script>__md_scope=new URL("..",location),__md_hash=e=>[...e].reduce((e,_)=>(e<<5)-e+_.charCodeAt(0),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script>
</head>
<body dir="ltr" data-md-color-scheme="default" data-md-color-primary="indigo" data-md-color-accent="indigo">
<script>var palette=__md_get("__palette");if(palette&&"object"==typeof palette.color)for(var key of Object.keys(palette.color))document.body.setAttribute("data-md-color-"+key,palette.color[key])</script>
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" for="__drawer"></label>
<div data-md-component="skip">
<a href="#api-reference" class="md-skip">
Skip to content
</a>
</div>
<div data-md-component="announce">
</div>
<header class="md-header md-header--shadow" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="Header">
<a href=".." title="Spiel" class="md-header__button md-logo" aria-label="Spiel" data-md-component="logo">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><!--! Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2023 Fonticons, Inc.--><path d="M192 96a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm-8 384V352h16v128c0 17.7 14.3 32 32 32s32-14.3 32-32V192h136c17.7 0 32-14.3 32-32s-14.3-32-32-32h-16V64h192v192H384v-32h-64v48c0 26.5 21.5 48 48 48h224c26.5 0 48-21.5 48-48V48c0-26.5-21.5-48-48-48H368c-26.5 0-48 21.5-48 48v80H177.1c-33.7 0-64.9 17.7-82.3 46.6l-58.3 97c-9.1 15.1-4.2 34.8 10.9 43.9s34.8 4.2 43.9-10.9l28.7-47.7V480c0 17.7 14.3 32 32 32s32-14.3 32-32z"/></svg>
</a>
<label class="md-header__button md-icon" for="__drawer">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3V6m0 5h18v2H3v-2m0 5h18v2H3v-2Z"/></svg>
</label>
<div class="md-header__title" data-md-component="header-title">
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
Spiel
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
<span class="md-ellipsis">
API Reference
</span>
</div>
</div>
</div>
<form class="md-header__option" data-md-component="palette">
<input class="md-option" data-md-color-media="(prefers-color-scheme: light)" data-md-color-scheme="default" data-md-color-primary="indigo" data-md-color-accent="indigo" aria-label="Switch to dark mode" type="radio" name="__palette" id="__palette_1">
<label class="md-header__button md-icon" title="Switch to dark mode" for="__palette_2" hidden>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a4 4 0 0 0-4 4 4 4 0 0 0 4 4 4 4 0 0 0 4-4 4 4 0 0 0-4-4m0 10a6 6 0 0 1-6-6 6 6 0 0 1 6-6 6 6 0 0 1 6 6 6 6 0 0 1-6 6m8-9.31V4h-4.69L12 .69 8.69 4H4v4.69L.69 12 4 15.31V20h4.69L12 23.31 15.31 20H20v-4.69L23.31 12 20 8.69Z"/></svg>
</label>
<input class="md-option" data-md-color-media="(prefers-color-scheme: dark)" data-md-color-scheme="slate" data-md-color-primary="indigo" data-md-color-accent="indigo" aria-label="Switch to light mode" type="radio" name="__palette" id="__palette_2">
<label class="md-header__button md-icon" title="Switch to light mode" for="__palette_1" hidden>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 18c-.89 0-1.74-.2-2.5-.55C11.56 16.5 13 14.42 13 12c0-2.42-1.44-4.5-3.5-5.45C10.26 6.2 11.11 6 12 6a6 6 0 0 1 6 6 6 6 0 0 1-6 6m8-9.31V4h-4.69L12 .69 8.69 4H4v4.69L.69 12 4 15.31V20h4.69L12 23.31 15.31 20H20v-4.69L23.31 12 20 8.69Z"/></svg>
</label>
</form>
<label class="md-header__button md-icon" for="__search">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5Z"/></svg>
</label>
<div class="md-search" data-md-component="search" role="dialog">
<label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search">
<form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" aria-label="Search" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="search-query" required>
<label class="md-search__icon md-icon" for="__search">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5Z"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12Z"/></svg>
</label>
<nav class="md-search__options" aria-label="Search">
<button type="reset" class="md-search__icon md-icon" title="Clear" aria-label="Clear" tabindex="-1">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41Z"/></svg>
</button>
</nav>
</form>
<div class="md-search__output">
<div class="md-search__scrollwrap" data-md-scrollfix>
<div class="md-search-result" data-md-component="search-result">
<div class="md-search-result__meta">
Initializing search
</div>
<ol class="md-search-result__list" role="presentation"></ol>
</div>
</div>
</div>
</div>
</div>
<div class="md-header__source">
<a href="https://github.com/JoshKarpel/spiel" title="Go to repository" class="md-source" data-md-component="source">
<div class="md-source__icon md-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2023 Fonticons, Inc.--><path d="M439.55 236.05 244 40.45a28.87 28.87 0 0 0-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 0 1-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 0 0 0 40.81l195.61 195.6a28.86 28.86 0 0 0 40.8 0l194.69-194.69a28.86 28.86 0 0 0 0-40.81z"/></svg>
</div>
<div class="md-source__repository">
GitHub
</div>
</a>
</div>
</nav>
</header>
<div class="md-container" data-md-component="container">
<main class="md-main" data-md-component="main">
<div class="md-main__inner md-grid">
<div class="md-sidebar md-sidebar--primary" data-md-component="sidebar" data-md-type="navigation" >
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
<a href=".." title="Spiel" class="md-nav__button md-logo" aria-label="Spiel" data-md-component="logo">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><!--! Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2023 Fonticons, Inc.--><path d="M192 96a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm-8 384V352h16v128c0 17.7 14.3 32 32 32s32-14.3 32-32V192h136c17.7 0 32-14.3 32-32s-14.3-32-32-32h-16V64h192v192H384v-32h-64v48c0 26.5 21.5 48 48 48h224c26.5 0 48-21.5 48-48V48c0-26.5-21.5-48-48-48H368c-26.5 0-48 21.5-48 48v80H177.1c-33.7 0-64.9 17.7-82.3 46.6l-58.3 97c-9.1 15.1-4.2 34.8 10.9 43.9s34.8 4.2 43.9-10.9l28.7-47.7V480c0 17.7 14.3 32 32 32s32-14.3 32-32z"/></svg>
</a>
Spiel
</label>
<div class="md-nav__source">
<a href="https://github.com/JoshKarpel/spiel" title="Go to repository" class="md-source" data-md-component="source">
<div class="md-source__icon md-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2023 Fonticons, Inc.--><path d="M439.55 236.05 244 40.45a28.87 28.87 0 0 0-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 0 1-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 0 0 0 40.81l195.61 195.6a28.86 28.86 0 0 0 40.8 0l194.69-194.69a28.86 28.86 0 0 0 0-40.81z"/></svg>
</div>
<div class="md-source__repository">
GitHub
</div>
</a>
</div>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href=".." class="md-nav__link">
<span class="md-ellipsis">
Introduction
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../quickstart/" class="md-nav__link">
<span class="md-ellipsis">
Quick Start
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../presenting/" class="md-nav__link">
<span class="md-ellipsis">
Presenting Decks
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../slides/" class="md-nav__link">
<span class="md-ellipsis">
Making Slides
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../transitions/" class="md-nav__link">
<span class="md-ellipsis">
Slide Transitions
</span>
</a>
</li>
<li class="md-nav__item md-nav__item--active">
<input class="md-nav__toggle md-toggle" type="checkbox" id="__toc">
<label class="md-nav__link md-nav__link--active" for="__toc">
<span class="md-ellipsis">
API Reference
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<a href="./" class="md-nav__link md-nav__link--active">
<span class="md-ellipsis">
API Reference
</span>
</a>
<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
<label class="md-nav__title" for="__toc">
<span class="md-nav__icon md-icon"></span>
Table of contents
</label>
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
<li class="md-nav__item">
<a href="#decks-and-slides" class="md-nav__link">
Decks and Slides
</a>
<nav class="md-nav" aria-label="Decks and Slides">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#spiel.Deck" class="md-nav__link">
Deck
</a>
<nav class="md-nav" aria-label="Deck">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#spiel.Deck.name" class="md-nav__link">
name
</a>
</li>
<li class="md-nav__item">
<a href="#spiel.Deck.default_transition" class="md-nav__link">
default_transition
</a>
</li>
<li class="md-nav__item">
<a href="#spiel.Deck.slide" class="md-nav__link">
slide()
</a>
</li>
<li class="md-nav__item">
<a href="#spiel.Deck.add_slides" class="md-nav__link">
add_slides()
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#spiel.Slide" class="md-nav__link">
Slide
</a>
<nav class="md-nav" aria-label="Slide">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#spiel.Slide.title" class="md-nav__link">
title
</a>
</li>
<li class="md-nav__item">
<a href="#spiel.Slide.content" class="md-nav__link">
content
</a>
</li>
<li class="md-nav__item">
<a href="#spiel.Slide.bindings" class="md-nav__link">
bindings
</a>
</li>
<li class="md-nav__item">
<a href="#spiel.Slide.transition" class="md-nav__link">
transition
</a>
</li>
</ul>
</nav>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#rendering-content" class="md-nav__link">
Rendering Content
</a>
<nav class="md-nav" aria-label="Rendering Content">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#spiel.Triggers" class="md-nav__link">
Triggers
</a>
<nav class="md-nav" aria-label="Triggers">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#spiel.Triggers.now" class="md-nav__link">
now
</a>
</li>
<li class="md-nav__item">
<a href="#spiel.Triggers.time_since_last_trigger" class="md-nav__link">
time_since_last_trigger
</a>
</li>
<li class="md-nav__item">
<a href="#spiel.Triggers.time_since_first_trigger" class="md-nav__link">
time_since_first_trigger
</a>
</li>
<li class="md-nav__item">
<a href="#spiel.Triggers.triggered" class="md-nav__link">
triggered
</a>
</li>
<li class="md-nav__item">
<a href="#spiel.Triggers.take" class="md-nav__link">
take()
</a>
</li>
</ul>
</nav>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#transitions" class="md-nav__link">
Transitions
</a>
<nav class="md-nav" aria-label="Transitions">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#spiel.Direction" class="md-nav__link">
Direction
</a>
<nav class="md-nav" aria-label="Direction">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#spiel.Direction.Next" class="md-nav__link">
Next
</a>
</li>
<li class="md-nav__item">
<a href="#spiel.Direction.Previous" class="md-nav__link">
Previous
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#spiel.Transition" class="md-nav__link">
Transition
</a>
<nav class="md-nav" aria-label="Transition">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#spiel.Transition.initialize" class="md-nav__link">
initialize()
</a>
</li>
<li class="md-nav__item">
<a href="#spiel.Transition.progress" class="md-nav__link">
progress()
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#spiel.Swipe" class="md-nav__link">
Swipe
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#presenting-decks" class="md-nav__link">
Presenting Decks
</a>
<nav class="md-nav" aria-label="Presenting Decks">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#spiel.present" class="md-nav__link">
present()
</a>
</li>
</ul>
</nav>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="../gallery/" class="md-nav__link">
<span class="md-ellipsis">
Gallery
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../contributing/" class="md-nav__link">
<span class="md-ellipsis">
Contributing Guide
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../changelog/" class="md-nav__link">
<span class="md-ellipsis">
Changelog
</span>
</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
<div class="md-sidebar md-sidebar--secondary" data-md-component="sidebar" data-md-type="toc" >
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
<label class="md-nav__title" for="__toc">
<span class="md-nav__icon md-icon"></span>
Table of contents
</label>
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
<li class="md-nav__item">
<a href="#decks-and-slides" class="md-nav__link">
Decks and Slides
</a>
<nav class="md-nav" aria-label="Decks and Slides">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#spiel.Deck" class="md-nav__link">
Deck
</a>
<nav class="md-nav" aria-label="Deck">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#spiel.Deck.name" class="md-nav__link">
name
</a>
</li>
<li class="md-nav__item">
<a href="#spiel.Deck.default_transition" class="md-nav__link">
default_transition
</a>
</li>
<li class="md-nav__item">
<a href="#spiel.Deck.slide" class="md-nav__link">
slide()
</a>
</li>
<li class="md-nav__item">
<a href="#spiel.Deck.add_slides" class="md-nav__link">
add_slides()
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#spiel.Slide" class="md-nav__link">
Slide
</a>
<nav class="md-nav" aria-label="Slide">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#spiel.Slide.title" class="md-nav__link">
title
</a>
</li>
<li class="md-nav__item">
<a href="#spiel.Slide.content" class="md-nav__link">
content
</a>
</li>
<li class="md-nav__item">
<a href="#spiel.Slide.bindings" class="md-nav__link">
bindings
</a>
</li>
<li class="md-nav__item">
<a href="#spiel.Slide.transition" class="md-nav__link">
transition
</a>
</li>
</ul>
</nav>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#rendering-content" class="md-nav__link">
Rendering Content
</a>
<nav class="md-nav" aria-label="Rendering Content">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#spiel.Triggers" class="md-nav__link">
Triggers
</a>
<nav class="md-nav" aria-label="Triggers">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#spiel.Triggers.now" class="md-nav__link">
now
</a>
</li>
<li class="md-nav__item">
<a href="#spiel.Triggers.time_since_last_trigger" class="md-nav__link">
time_since_last_trigger
</a>
</li>
<li class="md-nav__item">
<a href="#spiel.Triggers.time_since_first_trigger" class="md-nav__link">
time_since_first_trigger
</a>
</li>
<li class="md-nav__item">
<a href="#spiel.Triggers.triggered" class="md-nav__link">
triggered
</a>
</li>
<li class="md-nav__item">
<a href="#spiel.Triggers.take" class="md-nav__link">
take()
</a>
</li>
</ul>
</nav>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#transitions" class="md-nav__link">
Transitions
</a>
<nav class="md-nav" aria-label="Transitions">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#spiel.Direction" class="md-nav__link">
Direction
</a>
<nav class="md-nav" aria-label="Direction">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#spiel.Direction.Next" class="md-nav__link">
Next
</a>
</li>
<li class="md-nav__item">
<a href="#spiel.Direction.Previous" class="md-nav__link">
Previous
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#spiel.Transition" class="md-nav__link">
Transition
</a>
<nav class="md-nav" aria-label="Transition">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#spiel.Transition.initialize" class="md-nav__link">
initialize()
</a>
</li>
<li class="md-nav__item">
<a href="#spiel.Transition.progress" class="md-nav__link">
progress()
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#spiel.Swipe" class="md-nav__link">
Swipe
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#presenting-decks" class="md-nav__link">
Presenting Decks
</a>
<nav class="md-nav" aria-label="Presenting Decks">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#spiel.present" class="md-nav__link">
present()
</a>
</li>
</ul>
</nav>
</li>
</ul>
</nav>
</div>
</div>
</div>
<div class="md-content" data-md-component="content">
<article class="md-content__inner md-typeset">
<h1 id="api-reference">API Reference</h1>
<h2 id="decks-and-slides">Decks and Slides</h2>
<div class="doc doc-object doc-class">
<h3 id="spiel.Deck" class="doc doc-heading">
<code>spiel.Deck</code>
<span class="doc doc-labels">
<small class="doc doc-label doc-label-dataclass"><code>dataclass</code></small>
</span>
</h3>
<div class="doc doc-contents first">
<p class="doc doc-class-bases">
Bases: <code><a class="autorefs autorefs-external" title="collections.abc.Sequence" href="https://docs.python.org/3/library/collections.abc.html#collections.abc.Sequence">Sequence</a>[<a class="autorefs autorefs-internal" title="spiel.slide.Slide" href="#spiel.Slide">Slide</a>]</code></p>
<p>Represents a "deck" of "slides": a presentation.</p>
<div class="doc doc-children">
<div class="doc doc-object doc-attribute">
<h4 id="spiel.Deck.name" class="doc doc-heading">
<code class="highlight language-python"><span class="n">name</span><span class="p">:</span> <span class="nb">str</span></code>
<span class="doc doc-labels">
<small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small>
</span>
</h4>
<div class="doc doc-contents ">
<p>The name of the <a class="autorefs autorefs-internal" href="#spiel.Deck"><code>Deck</code></a>, which will be displayed in the footer.</p>
</div>
</div>
<div class="doc doc-object doc-attribute">
<h4 id="spiel.Deck.default_transition" class="doc doc-heading">
<code class="highlight language-python"><span class="n">default_transition</span><span class="p">:</span> <span class="n">Type</span><span class="p">[</span><span class="n">Transition</span><span class="p">]</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="n">Swipe</span></code>
<span class="doc doc-labels">
<small class="doc doc-label doc-label-class-attribute"><code>class-attribute</code></small>
<small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small>
</span>
</h4>
<div class="doc doc-contents ">
<p>The default slide transition animation;
used if the slide being moved to does not specify its own transition.
Defaults to the <a class="autorefs autorefs-internal" href="#spiel.Swipe"><code>Swipe</code></a> transition.
Set to <code>None</code> for no transition animation.</p>
</div>
</div>
<div class="doc doc-object doc-function">
<h4 id="spiel.Deck.slide" class="doc doc-heading">
<code class="highlight language-python"><span class="n">slide</span><span class="p">(</span><span class="n">title</span><span class="o">=</span><span class="s1">&#39;&#39;</span><span class="p">,</span> <span class="n">bindings</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">transition</span><span class="o">=</span><span class="kc">None</span><span class="p">)</span></code>
</h4>
<div class="doc doc-contents ">
<p>A decorator that creates a new slide in the deck,
with the decorated function as the <a class="autorefs autorefs-internal" href="#spiel.Slide.content"><code>Slide.content</code></a>.</p>
<table>
<thead>
<tr>
<th><b>PARAMETER</b></th>
<th><b> DESCRIPTION</b></th>
</tr>
</thead>
<tbody>
<tr>
<td><code>title</code></td>
<td class="doc-param-details">
<div class="doc-md-description">
<p>The title to display for the slide.</p>
</div>
<p>
<span class="doc-param-annotation">
<b>TYPE:</b>
<code><a class="autorefs autorefs-external" href="https://docs.python.org/3/library/stdtypes.html#str">str</a></code>
</span>
<span class="doc-param-default">
<b>DEFAULT:</b>
<code>&#39;&#39;</code>
</span>
</p>
</td>
</tr>
<tr>
<td><code>bindings</code></td>
<td class="doc-param-details">
<div class="doc-md-description">
<p>A mapping of
<a href="https://textual.textualize.io/guide/input/#key">keys</a>
to callables to be executed when those keys are pressed,
when on this slide.</p>
</div>
<p>
<span class="doc-param-annotation">
<b>TYPE:</b>
<code><a class="autorefs autorefs-external" title="collections.abc.Mapping" href="https://docs.python.org/3/library/collections.abc.html#collections.abc.Mapping">Mapping</a>[<a class="autorefs autorefs-external" href="https://docs.python.org/3/library/stdtypes.html#str">str</a>, <a class="autorefs autorefs-external" title="collections.abc.Callable" href="https://docs.python.org/3/library/collections.abc.html#collections.abc.Callable">Callable</a>[..., None]] | None</code>
</span>
<span class="doc-param-default">
<b>DEFAULT:</b>
<code>None</code>
</span>
</p>
</td>
</tr>
<tr>
<td><code>transition</code></td>
<td class="doc-param-details">
<div class="doc-md-description">
<p>The transition animation to use when moving to this slide.
Set to <code>None</code> to use the
<a class="autorefs autorefs-internal" href="#spiel.Deck.default_transition"><code>Deck.default_transition</code></a>
of the deck this slide is in.</p>
</div>
<p>
<span class="doc-param-annotation">
<b>TYPE:</b>
<code><a class="autorefs autorefs-external" title="typing.Type" href="https://docs.python.org/3/library/typing.html#typing.Type">Type</a>[<a class="autorefs autorefs-internal" title="spiel.transitions.protocol.Transition" href="#spiel.Transition">Transition</a>] | None</code>
</span>
<span class="doc-param-default">
<b>DEFAULT:</b>
<code>None</code>
</span>
</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="doc doc-object doc-function">
<h4 id="spiel.Deck.add_slides" class="doc doc-heading">
<code class="highlight language-python"><span class="n">add_slides</span><span class="p">(</span><span class="o">*</span><span class="n">slides</span><span class="p">)</span></code>
</h4>
<div class="doc doc-contents ">
<p>Add <code>Slide</code>s to a <code>Deck</code>.</p>
<p>This function is primarily useful when adding multiple slides at once,
probably generated programmatically.
If adding a single slide, prefer the <a class="autorefs autorefs-internal" href="#spiel.Deck.slide"><code>Deck.slide</code></a> decorator.</p>
<table>
<thead>
<tr>
<th><b>PARAMETER</b></th>
<th><b> DESCRIPTION</b></th>
</tr>
</thead>
<tbody>
<tr>
<td><code>*slides</code></td>
<td class="doc-param-details">
<div class="doc-md-description">
<p>The <code>Slide</code>s to add.</p>
</div>
<p>
<span class="doc-param-annotation">
<b>TYPE:</b>
<code><a class="autorefs autorefs-internal" title="spiel.slide.Slide" href="#spiel.Slide">Slide</a></code>
</span>
<span class="doc-param-default">
<b>DEFAULT:</b>
<code>()</code>
</span>
</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<div class="doc doc-object doc-class">
<h3 id="spiel.Slide" class="doc doc-heading">
<code>spiel.Slide</code>
<span class="doc doc-labels">
<small class="doc doc-label doc-label-dataclass"><code>dataclass</code></small>
</span>
</h3>
<div class="doc doc-contents first">
<p>Represents a single slide in the presentation.</p>
<div class="doc doc-children">
<div class="doc doc-object doc-attribute">
<h4 id="spiel.Slide.title" class="doc doc-heading">
<code class="highlight language-python"><span class="n">title</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span></code>
<span class="doc doc-labels">
<small class="doc doc-label doc-label-class-attribute"><code>class-attribute</code></small>
<small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small>
</span>
</h4>
<div class="doc doc-contents ">
<p>The title of the <code>Slide</code>, which will be displayed in the footer.</p>
</div>
</div>
<div class="doc doc-object doc-attribute">
<h4 id="spiel.Slide.content" class="doc doc-heading">
<code class="highlight language-python"><span class="n">content</span><span class="p">:</span> <span class="n">Content</span> <span class="o">=</span> <span class="n">Text</span></code>
<span class="doc doc-labels">
<small class="doc doc-label doc-label-class-attribute"><code>class-attribute</code></small>
<small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small>
</span>
</h4>
<div class="doc doc-contents ">
<p>A callable that is invoked by Spiel to display the slide's content.</p>
<p>The function may optionally take arguments with these names:</p>
<ul>
<li><code>trigger</code>: The current <a class="autorefs autorefs-internal" href="#spiel.Triggers"><code>Trigger</code></a> state, for use in animations.</li>
</ul>
</div>
</div>
<div class="doc doc-object doc-attribute">
<h4 id="spiel.Slide.bindings" class="doc doc-heading">
<code class="highlight language-python"><span class="n">bindings</span><span class="p">:</span> <span class="n">Mapping</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="n">Callable</span><span class="p">[</span><span class="o">...</span><span class="p">,</span> <span class="kc">None</span><span class="p">]]</span> <span class="o">=</span> <span class="n">field</span><span class="p">(</span><span class="n">default_factory</span><span class="o">=</span><span class="nb">dict</span><span class="p">)</span></code>
<span class="doc doc-labels">
<small class="doc doc-label doc-label-class-attribute"><code>class-attribute</code></small>
<small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small>
</span>
</h4>
<div class="doc doc-contents ">
<p>A mapping of
<a href="https://textual.textualize.io/guide/input/#key">keys</a>
to callables to be executed when those keys are pressed,
when on this slide.</p>
</div>
</div>
<div class="doc doc-object doc-attribute">
<h4 id="spiel.Slide.transition" class="doc doc-heading">
<code class="highlight language-python"><span class="n">transition</span><span class="p">:</span> <span class="n">Type</span><span class="p">[</span><span class="n">Transition</span><span class="p">]</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="n">Swipe</span></code>
<span class="doc doc-labels">
<small class="doc doc-label doc-label-class-attribute"><code>class-attribute</code></small>
<small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small>
</span>
</h4>
<div class="doc doc-contents ">
<p>The transition animation to use when moving to this slide.
Set to <code>None</code> to use the
<a class="autorefs autorefs-internal" href="#spiel.Deck.default_transition"><code>Deck.default_transition</code></a>
of the deck this slide is in.</p>
</div>
</div>
</div>
</div>
</div><h2 id="rendering-content">Rendering Content</h2>
<div class="doc doc-object doc-class">
<h3 id="spiel.Triggers" class="doc doc-heading">
<code>spiel.Triggers</code>
<span class="doc doc-labels">
<small class="doc doc-label doc-label-dataclass"><code>dataclass</code></small>
</span>
</h3>
<div class="doc doc-contents first">
<p class="doc doc-class-bases">
Bases: <code><a class="autorefs autorefs-external" title="collections.abc.Sequence" href="https://docs.python.org/3/library/collections.abc.html#collections.abc.Sequence">Sequence</a>[<a class="autorefs autorefs-external" href="https://docs.python.org/3/library/functions.html#float">float</a>]</code></p>
<p>Provides information to <a class="autorefs autorefs-internal" href="#spiel.Slide.content"><code>Slide.content</code></a> about the current slide's "trigger state".</p>
<p><code>Triggers</code> is a <a class="autorefs autorefs-external" href="https://docs.python.org/3/library/collections.abc.html#collections.abc.Sequence"><code>Sequence</code></a> of times
(produced by <a class="autorefs autorefs-external" href="https://docs.python.org/3/library/time.html#time.monotonic"><code>time.monotonic</code></a>)
that the current slide was triggered at.
Note that the slide will be triggered once when it starts being displayed,
so the first trigger time will be the time when the slide started being displayed.</p>
<div class="doc doc-children">
<div class="doc doc-object doc-attribute">
<h4 id="spiel.Triggers.now" class="doc doc-heading">
<code class="highlight language-python"><span class="n">now</span><span class="p">:</span> <span class="nb">float</span></code>
<span class="doc doc-labels">
<small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small>
</span>
</h4>
<div class="doc doc-contents ">
<p>The time that the slide content is being rendered at.
Use this is as a single consistent value to base relative times on.</p>
</div>
</div>
<div class="doc doc-object doc-attribute">
<h4 id="spiel.Triggers.time_since_last_trigger" class="doc doc-heading">
<code class="highlight language-python"><span class="n">time_since_last_trigger</span><span class="p">:</span> <span class="nb">float</span></code>
<span class="doc doc-labels">
<small class="doc doc-label doc-label-cached"><code>cached</code></small>
<small class="doc doc-label doc-label-property"><code>property</code></small>
</span>
</h4>
<div class="doc doc-contents ">
<p>The elapsed time since the most recent trigger.</p>
</div>
</div>
<div class="doc doc-object doc-attribute">
<h4 id="spiel.Triggers.time_since_first_trigger" class="doc doc-heading">
<code class="highlight language-python"><span class="n">time_since_first_trigger</span><span class="p">:</span> <span class="nb">float</span></code>
<span class="doc doc-labels">
<small class="doc doc-label doc-label-cached"><code>cached</code></small>
<small class="doc doc-label doc-label-property"><code>property</code></small>
</span>
</h4>
<div class="doc doc-contents ">
<p>The elapsed time since the first trigger,
which is equivalent to the time since the slide started being displayed.</p>
</div>
</div>
<div class="doc doc-object doc-attribute">
<h4 id="spiel.Triggers.triggered" class="doc doc-heading">
<code class="highlight language-python"><span class="n">triggered</span><span class="p">:</span> <span class="nb">bool</span></code>
<span class="doc doc-labels">
<small class="doc doc-label doc-label-cached"><code>cached</code></small>
<small class="doc doc-label doc-label-property"><code>property</code></small>
</span>
</h4>
<div class="doc doc-contents ">
<p>Returns whether the slide has been <em>manually</em> triggered
(i.e., this ignores the initial trigger from when the slide starts being displayed).</p>
</div>
</div>
<div class="doc doc-object doc-function">
<h4 id="spiel.Triggers.take" class="doc doc-heading">
<code class="highlight language-python"><span class="n">take</span><span class="p">(</span><span class="nb">iter</span><span class="p">,</span> <span class="n">offset</span><span class="o">=</span><span class="mi">1</span><span class="p">)</span></code>
</h4>
<div class="doc doc-contents ">
<p>Takes elements from the iterable <code>iter</code>
equal to the number of times in the <code>Triggers</code> minus the offset.</p>
<table>
<thead>
<tr>
<th><b>PARAMETER</b></th>
<th><b> DESCRIPTION</b></th>
</tr>
</thead>
<tbody>
<tr>
<td><code>iter</code></td>
<td class="doc-param-details">
<div class="doc-md-description">
<p>The iterable to take elements from.</p>
</div>
<p>
<span class="doc-param-annotation">
<b>TYPE:</b>
<code><a class="autorefs autorefs-external" title="collections.abc.Iterable" href="https://docs.python.org/3/library/collections.abc.html#collections.abc.Iterable">Iterable</a>[<span title="spiel.triggers.T">T</span>]</code>
</span>
</p>
</td>
</tr>
<tr>
<td><code>offset</code></td>
<td class="doc-param-details">
<div class="doc-md-description">
<p>This <code>offset</code> will be subtracted from the number of triggers,
reducing the number of elements that will be returned.
It defaults to <code>1</code> to ignore the automatic trigger from when the
slide starts being shown.</p>
</div>
<p>
<span class="doc-param-annotation">
<b>TYPE:</b>
<code><a class="autorefs autorefs-external" href="https://docs.python.org/3/library/functions.html#int">int</a></code>
</span>
<span class="doc-param-default">
<b>DEFAULT:</b>
<code>1</code>
</span>
</p>
</td>
</tr>
</tbody>
</table>
<table>
<thead>
<tr>
<th><b>RETURNS</b></th>
<th><b>DESCRIPTION</b></th>
</tr>
</thead>
<tbody>
<tr>
<td>
<span class="doc-returns-annotation">
<code><a class="autorefs autorefs-external" title="typing.Iterator" href="https://docs.python.org/3/library/typing.html#typing.Iterator">Iterator</a>[<span title="spiel.triggers.T">T</span>]</code>
</span>
</td>
<td class="doc-returns-details">
<div class="doc-md-description">
<p>An iterator over the first <code>len(self) - offset</code> elements of <code>iter</code>.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div><h2 id="transitions">Transitions</h2>
<div class="doc doc-object doc-class">
<h3 id="spiel.Direction" class="doc doc-heading">
<code>spiel.Direction</code>
</h3>
<div class="doc doc-contents first">
<p class="doc doc-class-bases">
Bases: <code><a class="autorefs autorefs-external" title="enum.Enum" href="https://docs.python.org/3/library/enum.html#enum.Enum">Enum</a></code></p>
<p>An enumeration that describes which direction a slide transition
animation should move in: whether we're going to the next slide,
or to the previous slide.</p>
<div class="doc doc-children">
<div class="doc doc-object doc-attribute">
<h4 id="spiel.Direction.Next" class="doc doc-heading">
<code class="highlight language-python"><span class="n">Next</span> <span class="o">=</span> <span class="s1">&#39;next&#39;</span></code>
<span class="doc doc-labels">
<small class="doc doc-label doc-label-class-attribute"><code>class-attribute</code></small>
<small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small>
</span>
</h4>
<div class="doc doc-contents ">
<p>Indicates that the transition should handle going to the next slide.</p>
</div>
</div>
<div class="doc doc-object doc-attribute">
<h4 id="spiel.Direction.Previous" class="doc doc-heading">
<code class="highlight language-python"><span class="n">Previous</span> <span class="o">=</span> <span class="s1">&#39;previous&#39;</span></code>
<span class="doc doc-labels">
<small class="doc doc-label doc-label-class-attribute"><code>class-attribute</code></small>
<small class="doc doc-label doc-label-instance-attribute"><code>instance-attribute</code></small>
</span>
</h4>
<div class="doc doc-contents ">
<p>Indicates that the transition should handle going to the previous slide.</p>
</div>
</div>
</div>
</div>
</div>
<div class="doc doc-object doc-class">
<h3 id="spiel.Transition" class="doc doc-heading">
<code>spiel.Transition</code>
</h3>
<div class="doc doc-contents first">
<p class="doc doc-class-bases">
Bases: <code><a class="autorefs autorefs-external" title="typing.Protocol" href="https://docs.python.org/3/library/typing.html#typing.Protocol">Protocol</a></code></p>
<p>A protocol that describes how to implement a transition animation.</p>
<p>See <a href="../transitions/#writing-custom-transitions">Writing Custom Transitions</a>
for more details on how to implement the protocol.</p>
<div class="doc doc-children">
<div class="doc doc-object doc-function">
<h4 id="spiel.Transition.initialize" class="doc doc-heading">
<code class="highlight language-python"><span class="n">initialize</span><span class="p">(</span><span class="n">from_widget</span><span class="p">,</span> <span class="n">to_widget</span><span class="p">,</span> <span class="n">direction</span><span class="p">)</span></code>
</h4>
<div class="doc doc-contents ">
<p>A hook function to set up any CSS that should be present at the start of the transition.</p>
<table>
<thead>
<tr>
<th><b>PARAMETER</b></th>
<th><b> DESCRIPTION</b></th>
</tr>
</thead>
<tbody>
<tr>
<td><code>from_widget</code></td>
<td class="doc-param-details">
<div class="doc-md-description">
<p>The widget showing the slide that we are leaving.</p>
</div>
<p>
<span class="doc-param-annotation">
<b>TYPE:</b>
<code><a class="autorefs autorefs-external" title="textual.widget.Widget" href="https://textual.textualize.io/api/widget/#textual.widget.Widget">Widget</a></code>
</span>
</p>
</td>
</tr>
<tr>
<td><code>to_widget</code></td>
<td class="doc-param-details">
<div class="doc-md-description">
<p>The widget showing the slide that we are entering.</p>
</div>
<p>
<span class="doc-param-annotation">
<b>TYPE:</b>
<code><a class="autorefs autorefs-external" title="textual.widget.Widget" href="https://textual.textualize.io/api/widget/#textual.widget.Widget">Widget</a></code>
</span>
</p>
</td>
</tr>
<tr>
<td><code>direction</code></td>
<td class="doc-param-details">
<div class="doc-md-description">
<p>The desired direction of the transition animation.</p>
</div>
<p>
<span class="doc-param-annotation">
<b>TYPE:</b>
<code><a class="autorefs autorefs-internal" title="spiel.transitions.protocol.Direction" href="#spiel.Direction">Direction</a></code>
</span>
</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="doc doc-object doc-function">
<h4 id="spiel.Transition.progress" class="doc doc-heading">
<code class="highlight language-python"><span class="n">progress</span><span class="p">(</span><span class="n">from_widget</span><span class="p">,</span> <span class="n">to_widget</span><span class="p">,</span> <span class="n">direction</span><span class="p">,</span> <span class="n">progress</span><span class="p">)</span></code>
</h4>
<div class="doc doc-contents ">
<p>A hook function that is called each time the <code>progress</code>
of the transition animation updates.</p>
<table>
<thead>
<tr>
<th><b>PARAMETER</b></th>
<th><b> DESCRIPTION</b></th>
</tr>
</thead>
<tbody>
<tr>
<td><code>from_widget</code></td>
<td class="doc-param-details">
<div class="doc-md-description">
<p>The widget showing the slide that we are leaving.</p>
</div>
<p>
<span class="doc-param-annotation">
<b>TYPE:</b>
<code><a class="autorefs autorefs-external" title="textual.widget.Widget" href="https://textual.textualize.io/api/widget/#textual.widget.Widget">Widget</a></code>
</span>
</p>
</td>
</tr>
<tr>
<td><code>to_widget</code></td>
<td class="doc-param-details">
<div class="doc-md-description">
<p>The widget showing the slide that we are entering.</p>
</div>
<p>
<span class="doc-param-annotation">
<b>TYPE:</b>
<code><a class="autorefs autorefs-external" title="textual.widget.Widget" href="https://textual.textualize.io/api/widget/#textual.widget.Widget">Widget</a></code>
</span>
</p>
</td>
</tr>
<tr>
<td><code>direction</code></td>
<td class="doc-param-details">
<div class="doc-md-description">
<p>The desired direction of the transition animation.</p>
</div>
<p>
<span class="doc-param-annotation">
<b>TYPE:</b>
<code><a class="autorefs autorefs-internal" title="spiel.transitions.protocol.Direction" href="#spiel.Direction">Direction</a></code>
</span>
</p>
</td>
</tr>
<tr>
<td><code>progress</code></td>
<td class="doc-param-details">
<div class="doc-md-description">
<p>The progress of the animation, as a percentage
(e.g., initial state is <code>0</code>, final state is <code>100</code>).
Note that this is <strong>not necessarily</strong> bounded between <code>0</code> and <code>100</code>,
nor is it necessarily <a href="https://en.wikipedia.org/wiki/Monotonic_function">monotonically increasing</a>,
depending on the underlying Textual animation easing function,
which may overshoot or bounce.
However, it will always start at <code>0</code> and end at <code>100</code>,
no matter which <code>direction</code> the transition should move in.</p>
</div>
<p>
<span class="doc-param-annotation">
<b>TYPE:</b>
<code><a class="autorefs autorefs-external" href="https://docs.python.org/3/library/functions.html#float">float</a></code>
</span>
</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<div class="doc doc-object doc-class">
<h3 id="spiel.Swipe" class="doc doc-heading">
<code>spiel.Swipe</code>
</h3>
<div class="doc doc-contents first">
<p class="doc doc-class-bases">
Bases: <code><a class="autorefs autorefs-internal" title="spiel.transitions.protocol.Transition" href="#spiel.Transition">Transition</a></code></p>
<p>A transition where the current and incoming slide are placed side-by-side
and gradually slide across the screen,
with the current slide leaving and the incoming slide entering.</p>
<div class="doc doc-children">
</div>
</div>
</div><h2 id="presenting-decks">Presenting Decks</h2>
<div class="doc doc-object doc-function">
<h3 id="spiel.present" class="doc doc-heading">
<code class="highlight language-python"><span class="n">spiel</span><span class="o">.</span><span class="n">present</span><span class="p">(</span><span class="n">deck_path</span><span class="p">,</span> <span class="n">watch_path</span><span class="o">=</span><span class="kc">None</span><span class="p">)</span></code>
</h3>
<div class="doc doc-contents first">
<p>Present the deck defined in the given <code>deck_path</code>.</p>
<table>
<thead>
<tr>
<th><b>PARAMETER</b></th>
<th><b> DESCRIPTION</b></th>
</tr>
</thead>
<tbody>
<tr>
<td><code>deck_path</code></td>
<td class="doc-param-details">
<div class="doc-md-description">
<p>The file to look for a deck in.</p>
</div>
<p>
<span class="doc-param-annotation">
<b>TYPE:</b>
<code><a class="autorefs autorefs-external" title="pathlib.Path" href="https://docs.python.org/3/library/pathlib.html#pathlib.Path">Path</a> | <a class="autorefs autorefs-external" href="https://docs.python.org/3/library/stdtypes.html#str">str</a></code>
</span>
</p>
</td>
</tr>
<tr>
<td><code>watch_path</code></td>
<td class="doc-param-details">
<div class="doc-md-description">
<p>When filesystem changes are detected below this path (recursively), reload the deck from the <code>deck_path</code>.
If <code>None</code> (the default), use the parent directory of the <code>deck_path</code>.</p>
</div>
<p>
<span class="doc-param-annotation">
<b>TYPE:</b>
<code><a class="autorefs autorefs-external" title="pathlib.Path" href="https://docs.python.org/3/library/pathlib.html#pathlib.Path">Path</a> | <a class="autorefs autorefs-external" href="https://docs.python.org/3/library/stdtypes.html#str">str</a> | None</code>
</span>
<span class="doc-param-default">
<b>DEFAULT:</b>
<code>None</code>
</span>
</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</article>
</div>
</div>
</main>
<footer class="md-footer">
<div class="md-footer-meta md-typeset">
<div class="md-footer-meta__inner md-grid">
<div class="md-copyright">
Made with
<a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs
</a>
</div>
<div class="md-social">
<a href="https://github.com/JoshKarpel/spiel" target="_blank" rel="noopener" title="Spiel on GitHub" class="md-social__link">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512"><!--! Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2023 Fonticons, Inc.--><path d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"/></svg>
</a>
</div>
</div>
</div>
</footer>
</div>
<div class="md-dialog" data-md-component="dialog">
<div class="md-dialog__inner md-typeset"></div>
</div>
<script id="__config" type="application/json">{"base": "..", "features": ["navigation.instant", "navigation.tracking", "navigation.sections", "navigation.indexes", "toc.follow", "content.code.annotate", "content.code.copy"], "search": "../assets/javascripts/workers/search.f886a092.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}}</script>
<script src="../assets/javascripts/bundle.94c44541.min.js"></script>
</body>
</html>