"""Small pieces the view pages share: a page heading with a breadcrumb, and rows of things that are not trails.""" import re from . import words from .markup import Markup, esc def head(h1, lede_html, crumbs, *, kicker=""): """The page-head block. crumbs: [(text, href)] leading to this page; lede_html is HTML.""" items = "".join(f'
{esc(kicker)}
' if kicker else "" return f"""{lede_html}
{tag}
' if tag else "" h = f"h{level}" if heading else "p" paras = "".join(f'{t}
' for t in text if str(t).strip()) line = "".join(f'{f}' for f in facts if str(f).strip()) line = f'' if line else "" fine = " · ".join(str(x) for x in small if str(x).strip()) fine = f'{fine}
' if fine else "" return (f'