#let gloss(
  txt: none,
  translit: none,
  phono: none,
  morphemes: none,
  translation: none,
  txt-style: it => it,
  translit-style: it => it,
  phono-style: it => it,
  morphemes-style: it => it,
  translation-style: it => it,

) = {
    assert(type(morphemes) == array)
    assert(translation == none or type(translation) == content)
    assert(txt == none or type(txt) == content or (type(txt) == array and txt.len() == morphemes.len()))
    assert(translit == none or (type(translit) == array and translit.len() == morphemes.len()))
    assert(translit == none or (type(phono) == array and phono.len() == morphemes.len()))
    html.table(class: "gloss",
      {
        if type(txt) == content {
          html.tr(html.td(colspan: morphemes.len(), txt-style(txt)))
        } else if type(txt) == array {
          html.tr(txt.map(txt-style).map(html.td).join())
        }
        if translit != none {
          html.tr(translit.map(translit-style).map(html.td).join())
        }
        if phono != none {
          html.tr(phono.map(phono-style).map(html.td).join())
        }
        html.tr(morphemes.map(morphemes-style).map(html.td).join())
        if translation != none { html.tr(html.td(colspan: morphemes.len(),translation-style(translation))) }
      }
    )
  }
#let example(..g, lbl: none, caption: none) = [
  #figure(kind: "gloss", caption: caption, gloss(..g)) #if lbl != none {label(lbl)}
]
