File tree Expand file tree Collapse file tree 3 files changed +3
-31
lines changed
Expand file tree Collapse file tree 3 files changed +3
-31
lines changed Original file line number Diff line number Diff line change @@ -89,12 +89,6 @@ class ImageSpec(PathSpec):
8989 data : str | None = None
9090
9191
92- class StyleDict (BaseModel ):
93- """Style configuration."""
94-
95- highlight_color : str | None = None
96-
97-
9892class Directories (BaseModel ):
9993 """Directories configuration."""
10094
Original file line number Diff line number Diff line change 1010import jinja2
1111
1212from . import processing
13- from .config import ImageSpec , StyleDict
13+ from .config import ImageSpec
1414
1515__all__ = [
1616 "create_env" ,
@@ -94,24 +94,12 @@ def create_env(
9494def prepare_template_context (
9595 context : dict [str ], images_dir : Path | None = None
9696) -> dict [str ]:
97- """Prepare template context with variables/styles/images
98-
99- Resolves variables, styles and encodes images.
97+ """Encode images for template context
10098
10199 Args:
102- config: Configuration with optional styles and images
100+ config: Configuration with optional images
103101 images_dir: Directory containing images to encode
104102 """
105- # Resolve style references to actual theme colors
106- if "style" in context and "theme" in context :
107- style = context ["style" ]
108- theme = context ["theme" ]
109- resolved_style : StyleDict = {}
110- for key , value in style .items ():
111- resolved_style [key ] = theme [value ]
112- context ["style" ] = resolved_style
113-
114- # Process image references
115103 if context .get ("images" ) is not None :
116104 context ["images" ] = encode_images (context ["images" ], images_dir )
117105
Original file line number Diff line number Diff line change @@ -51,16 +51,6 @@ def test_highlighting_template_no_style() -> None:
5151
5252
5353# Context preparation tests
54- def test_prepare_template_context_styles () -> None :
55- """Test style resolution in template context."""
56- config = {
57- "style" : {"color" : "primary" },
58- "theme" : {"primary" : "#ff0000" },
59- }
60- context = prepare_template_context (config )
61- assert context ["style" ]["color" ] == "#ff0000"
62-
63-
6454def test_prepare_template_context_images (tmp_path : Path ) -> None :
6555 """Test image processing in template context."""
6656 # Create test image
You can’t perform that action at this time.
0 commit comments