vibe.list_formatter

Logic for formatting lists of items into grammatically correct sentences or lists.

format_conditional_list

format_conditional_list(items: list[str], style: str, conjunction: str, locale: str, transform: str | None = None) -> str

Format a list of strings into a grammatically correct phrase or HTML list.

Parameters:
  • items (list[str]) –

    The list of item strings that should be included.

  • style (str) –

    'paragraph' or 'list'.

  • conjunction (str) –

    The conjunction to use ('and', 'or', 'and/or', etc.).

  • locale (str) –

    The current locale ('en', 'sv', etc.).

  • transform (str | None, default: None ) –

    An optional transformation to apply to each item.