From 82f8c7a721a0d7c1f992cdecdb0a00c6d18573b2 Mon Sep 17 00:00:00 2001 From: "Christoph J. Scherr" Date: Tue, 25 Feb 2025 18:32:50 +0100 Subject: [PATCH] feat: store lines of a haiku, not just as a str Refs: OPS-24 --- senju/haiku.py | 2 +- senju/templates/haiku.html | 28 ++++++++++++++-------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/senju/haiku.py b/senju/haiku.py index 6d7aeff..15d2a28 100644 --- a/senju/haiku.py +++ b/senju/haiku.py @@ -3,4 +3,4 @@ from dataclasses import dataclass @dataclass class Haiku: - text: str + lines: list[str] diff --git a/senju/templates/haiku.html b/senju/templates/haiku.html index 39feb77..844dfff 100644 --- a/senju/templates/haiku.html +++ b/senju/templates/haiku.html @@ -2,19 +2,19 @@ {% block content %}
-
-
-

Haiku of the Day

-

- An old silent pond
- A frog jumps into the pond—
- Splash! Silence again. -

-
- - Back to Home - -
+
+
+

{{ title }}

+

+ {% for line in context.haiku.lines %} + {{ line }}
+ {% endfor %} +

+
+ + Back to Home + +
{% endblock %} -