Tayori.Category (Tayori v0.1.0)

Copy Markdown View Source

A category of entries ("New", "Improved", "Fixed"): a key, its name in each language, a colour and its place in the list. Entries keep the keys of their categories.

The colour is one of colors/0, a name the themes give a hue to (--tayori-category-blue, say), so that a category looks right in every theme, light and dark.

Summary

Functions

The colours a category can have.

The name of a category in a language, else in the first of locales, else its key.

Types

t()

@type t() :: %Tayori.Category{
  __meta__: term(),
  color: String.t(),
  inserted_at: term(),
  key: String.t() | nil,
  names: %{optional(String.t()) => String.t()},
  position: integer(),
  updated_at: term()
}

Functions

colors()

@spec colors() :: [String.t()]

The colours a category can have.

name(category, locale, locales)

@spec name(t(), String.t() | nil, [String.t()]) :: String.t()

The name of a category in a language, else in the first of locales, else its key.