Teaching recipes

An Arabic AI lesson

from jupyter_lecture_studio import LectureDeck

deck = LectureDeck(course="الذكاء الاصطناعي", series="AI SERIES", lesson="03")
deck.cover("البحث في فضاء الحالات", "نمثل المشكلة ثم نتتبع البحث.", tags=["نمذجة", "توقع", "تفسير"])
deck.slide("تتبع القرار", diagram={
    "title": "من السؤال إلى الحل",
    "direction": "rtl",
    "nodes": [{"value": "حالة البداية"}, {"value": "استكشاف"}, {"value": "الهدف", "selected": True}],
})

An English SQL lesson

from jupyter_lecture_studio import LectureDeck

deck = LectureDeck(course="Databases", language="sql", direction="ltr", theme="emerald")
deck.slide("Filter rows", cards=[{
    "title": "Passing grades",
    "code": "SELECT name, grade FROM students WHERE grade >= 60;",
    "reason": "The predicate keeps only rows that meet the condition.",
}])

Install [highlight] for SQL syntax colors.

Keep motion optional

from jupyter_lecture_studio import LectureDeck

deck = LectureDeck(course="Algorithms", motion=False)
deck.slide("Focus on the reasoning", diagram="loop")

The information remains visible when animation is disabled. Closing and reopening a diagram is available even without animation.

Reuse an identity across a course

from jupyter_lecture_studio import Brand, LectureDeck, Theme

brand = Brand(course="Software Engineering", series="SOFTWARE SERIES", lesson="04", language="java")
theme = Theme(preset="ocean", direction="ltr", motion=True)
deck = LectureDeck(brand=brand, theme=theme)

Create a new deck for each lecture, keeping the same series and theme. Change the lesson label and its content. Reusing the same mutable deck for unrelated lectures would also share slide numbering and export contents.

Export from a build script

from jupyter_lecture_studio import LectureDeck

deck = LectureDeck.from_file("lecture.json", show=False)
output = deck.export("build/lecture.html", title="My lecture")
print(output)

This path needs no IPython. It is useful for preparing student handouts from content kept in JSON.