diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2023-08-07 12:49:54 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2023-08-07 15:16:41 +0200 |
commit | 0498331a15cfa8de7f2c3f4a761695ae21ae6245 (patch) | |
tree | 6c4a19fe4275a2b5a83fb9ec2da3648acb8a31ec /mu4web/components.py | |
parent | Stop reusing salt for passwords. (diff) | |
download | mu4web-0498331a15cfa8de7f2c3f4a761695ae21ae6245.tar.gz mu4web-0498331a15cfa8de7f2c3f4a761695ae21ae6245.tar.xz |
Introduce dl function.
Diffstat (limited to 'mu4web/components.py')
-rw-r--r-- | mu4web/components.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/mu4web/components.py b/mu4web/components.py index e9701de..07ab400 100644 --- a/mu4web/components.py +++ b/mu4web/components.py @@ -9,6 +9,16 @@ from .html_render import HTML from typing import cast, Optional from urllib.parse import urlencode from email.message import EmailMessage +from typing import Iterable + + +def dl(entries: Iterable[tuple[HTML, HTML]]) -> HTML: + """Build a description list.""" + items = [] + for k, v in entries: + items += [('dt', k), + ('dd', v)] + return ('dl', items) def format_email(addr: Address) -> list[HTML]: |