Skip to content

Commit

Permalink
Store list of slides in the Python layer
Browse files Browse the repository at this point in the history
Achieving more backwards compatibility with Elsie :D
  • Loading branch information
Kobzol authored and spirali committed Sep 27, 2024
1 parent aefe1b7 commit 0653d85
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions python/nelsie/slidedeck.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import pathlib
from typing import Literal
from typing import Literal, List

from . import nelsie as nelsie_rs
from .basictypes import parse_debug_layout
Expand Down Expand Up @@ -115,6 +115,7 @@ def __init__(
self.default_code_theme = default_code_theme
self.default_code_language = default_code_language
self._deck = nelsie_rs.Deck(resources, default_font, default_monospace_font)
self._slides: List[Slide] = []

def set_style(self, name: str, style: TextStyle):
self._deck.set_style(self.resources, name, style, False, None, None)
Expand Down Expand Up @@ -152,7 +153,10 @@ def new_slide(
image_directory = self.image_directory
debug_layout = parse_debug_layout(debug_layout)
slide_id = self._deck.new_slide(width, height, bg_color, name, step_1, debug_steps, counters, parent_slide)
return Slide(self, slide_id, name, image_directory, debug_layout)

slide = Slide(self, slide_id, name, image_directory, debug_layout)
self._slides.append(slide)
return slide

def slide(
self,
Expand Down

0 comments on commit 0653d85

Please sign in to comment.