| 42 | |
| 43 | @dataclass |
| 44 | class Lesson: |
| 45 | module_title: str |
| 46 | module_order: int |
| 47 | title: str |
| 48 | body_lines: List[str] = field(default_factory=list) |
| 49 | lesson_order_in_module: int = 0 |
| 50 | global_order: int = 0 |
| 51 | |
| 52 | def summary(self) -> str: |
| 53 | for line in self.body_lines: |
| 54 | t = line.strip() |
| 55 | if not t: |
| 56 | continue |
| 57 | if t.startswith("{{<") or t.startswith("!["): |
| 58 | continue |
| 59 | if t.startswith("*") or t.startswith("-"): |
| 60 | continue |
| 61 | return t[:190] |
| 62 | return "Watch the lesson and follow the accompanying resources." |
| 63 | |
| 64 | |
| 65 | @dataclass |