-
Notifications
You must be signed in to change notification settings - Fork 3
Description
Notes to self: (this ticket might explode out into a handful of separate ones)
It's gotten messy.
-
It's not 100% consistent what gets set as an instance attribute vs. getting looked up from the self.config dictionaries.
Lazy load configs - should not be afraid of creating a PDFBakerDocument because it immediately tries to load a config file. -
There are types for typehints, and a PDFBakerOptions dataclass. Nothing really in terms of validating the YAML beyond its syntax. I'll go with Pydantic (2.11.3) and make these all BaseModel. That still serves the typehints but also adds validation when I instantiate with a value from YAML.
-
Implement this top-down. Make the Baker nice, then proceed to Document, then Page.
-
Images need special attention: Support full spec of name/path/type(/size?). Support multiple image directories. Support multiple image directories #24
-
Absolute paths are not getting tested yet.
(tests should just create a temporary config then use its absolute path as the starting point)
Working with PathSpec (name/path/etc.) and Path vs. string (from YAML) is a general issue and should be handled in exactly one place. Special logic ("just a name" for document means directory with config.yaml, for page means {name}.yaml inside "pages" directory) can be delegated to subclasses.