def passageLinks(passages, sec0Type, sec0, sec1, tillLevel):
    """Provide navigation links for passages,

    in the form of links to sections of level 0, 1 and 2 (books, chapters and verses).

    If `sec0` is not given, only a list of sec0 links is produced.

    If `sec0` is given, but `sec1` not, a list of links for sec1s within the given `sec0`
    is produced.

    If both `sec0` and `sec1` are given, de sec1 entry is focused.
    """

    sec0s = []
    sec1s = []
    for s0 in passages[0]:
        selected = str(s0) == str(sec0)
        sec0s.append(
            f'<a href="#" class="s0nav {" focus" if selected else ""}">{s0}</a>'
        )
    if sec0:
        for s1 in passages[1]:
            selected = str(s1) == str(sec1)
            sec1s.append(
                f'<a href="#" class="s1nav {" focus" if selected else ""}">{s1}</a>'
            )
    return (
        f'<div class="sline"><span><span id="s0total"></span>'
        f' <span class="s0total">{sec0Type}s</span></span>'
        + "".join(sec0s)
        + '</div><div class="sline">'
        + "".join(sec1s)
        + "</div>"
    )