quatuorbellefeuille.com

Content, build scripts and admin scripts for the Bellefeuille Quartet website.
git clone https://git.kevinlegouguec.net/quatuorbellefeuille.com
Log | Files | Refs

commit 099395ed6f5b3694c0c733293c241140089cbfe7
parent 9372b46a1636eb6b18b3df627eb62b324dfce3f6
Author: Kévin Le Gouguec <kevin.legouguec@gmail.com>
Date:   Tue, 22 Feb 2022 22:39:18 +0100

[wip] Make sure "touched up" plaintext is not mangled

Diffstat:
Mbuild-feed.py | 14++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/build-feed.py b/build-feed.py @@ -7,7 +7,7 @@ from sys import argv from urllib.parse import urljoin from lxml.builder import E -from lxml.etree import CDATA, indent, tostring +from lxml.etree import CDATA, XML, indent, tostring from helpers import ( DATE_FORMATTERS, @@ -75,6 +75,14 @@ def join(sequence, joiner_factory): result.append(joiner_factory()) +def piece_list(pieces): + ol_list = E.ol( + *(XML(f'<li>{touchup_plaintext(p)}</li>') for p in pieces) + ) + indent(ol_list) + return ol_list + + CDATA_INDENT = 8*' ' @@ -90,9 +98,7 @@ def cdata_concert(concert, lang): E.p(formatters['date'](concert.time)), E.p(formatters['time'](concert.time)), E.p(*join(concert.address.splitlines(), E.br)), - E.ol( - *(E.li(touchup_plaintext(p)) for p in concert.pieces.splitlines()) - ), + piece_list(concert.pieces.splitlines()), *(E.p(line) for line in concert.instructions.splitlines()), ))