mirror of
https://github.com/jeertmans/manim-slides.git
synced 2025-09-19 04:16:02 +08:00
feat(lib): enhance notes support (#324)
* feat(lib): enhance notes support TODO: fix keyboard inputs and window order with `present`. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * chore(lint): allow too complex * wip: presenter mode * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * feat(cli): add presenter view --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
@ -3,6 +3,7 @@ import shutil
|
||||
from functools import wraps
|
||||
from inspect import Parameter, signature
|
||||
from pathlib import Path
|
||||
from textwrap import dedent
|
||||
from typing import Any, Callable, Dict, List, Optional, Set, Tuple
|
||||
|
||||
import rtoml
|
||||
@ -145,6 +146,7 @@ class BaseSlideConfig(BaseModel): # type: ignore
|
||||
playback_rate: float = 1.0
|
||||
reversed_playback_rate: float = 1.0
|
||||
notes: str = ""
|
||||
dedent_notes: bool = True
|
||||
|
||||
@classmethod
|
||||
def wrapper(cls, arg_name: str) -> Callable[..., Any]:
|
||||
@ -188,6 +190,16 @@ class BaseSlideConfig(BaseModel): # type: ignore
|
||||
|
||||
return _wrapper_
|
||||
|
||||
@model_validator(mode="after")
|
||||
@classmethod
|
||||
def apply_dedent_notes(
|
||||
cls, base_slide_config: "BaseSlideConfig"
|
||||
) -> "BaseSlideConfig":
|
||||
if base_slide_config.dedent_notes:
|
||||
base_slide_config.notes = dedent(base_slide_config.notes)
|
||||
|
||||
return base_slide_config
|
||||
|
||||
|
||||
class PreSlideConfig(BaseSlideConfig):
|
||||
"""Slide config to be used prior to rendering."""
|
||||
|
Reference in New Issue
Block a user