Skip to content

Commit 7be9431

Browse files
committed
Change "highlight_colour" to "highlight_color"
1 parent fa44ab8 commit 7be9431

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

docs/configuration.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ project/
2828
| `svg2pdf_backend` | string | `"cairosvg"` | Backend to use for SVG to PDF conversion. `"cairosvg"` is built-in, `"inkscape"` requires Inkscape to be installed |
2929

3030
You can use `<highlight>text</highlight>` tags in your templates, and they will be
31-
highlighted in the color specified by the `highlight_colour` in your `style`.
31+
highlighted in the color specified by the `highlight_color` in your `style`.
3232

3333
Example:
3434

@@ -40,7 +40,7 @@ documents:
4040
- material_specs
4141

4242
style:
43-
highlight_colour: teal # Color for <highlight>text</highlight> tags
43+
highlight_color: teal # Color for <highlight>text</highlight> tags
4444
font_family: "Helvetica Neue"
4545
heading_size: large # from theme
4646
spacing: normal # from theme
@@ -178,8 +178,8 @@ The entire merged configuration is available to your templates. This means:
178178
| Any other keys | All other configuration is passed through as-is |
179179

180180
You can use `<highlight>text</highlight>` tags in your templates, and they will be
181-
highlighted in the color specified by the `highlight_colour` in your `style` (see "Main
182-
Configuration File" above). |
181+
highlighted in the color specified by the `highlight_color` in your `style` (see "Main
182+
Configuration File" above).
183183

184184
## Document Variants
185185

src/pdfbaker/render.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,12 @@ def render(self, *args: Any, **kwargs: Any) -> str:
5454
"""Render the template and apply highlighting to the result."""
5555
rendered = super().render(*args, **kwargs)
5656

57-
if "style" in kwargs and "highlight_colour" in kwargs["style"]:
58-
highlight_colour = kwargs["style"]["highlight_colour"]
57+
if "style" in kwargs and "highlight_color" in kwargs["style"]:
58+
highlight_color = kwargs["style"]["highlight_color"]
5959

6060
def replacer(match: re.Match[str]) -> str:
6161
content = match.group(1)
62-
return f'<tspan style="fill:{highlight_colour}">{content}</tspan>'
62+
return f'<tspan style="fill:{highlight_color}">{content}</tspan>'
6363

6464
rendered = re.sub(r"<highlight>(.*?)</highlight>", replacer, rendered)
6565

src/pdfbaker/types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
class StyleDict(TypedDict):
77
"""Style configuration."""
88

9-
highlight_colour: NotRequired[str]
9+
highlight_color: NotRequired[str]
1010

1111

1212
class ImageSpec(TypedDict):

0 commit comments

Comments
 (0)