# `PhoenixKitDocumentCreator.Variable`
[🔗](https://github.com/BeamLabEU/phoenix_kit_document_creator/blob/0.2.8/lib/phoenix_kit_document_creator/variable.ex#L1)

Variable definitions for document templates.

Variables are `{{ variable_name }}` placeholders in Google Docs templates that
get substituted with actual values via the Google Docs `replaceAllText` API.

# `t`

```elixir
@type t() :: %PhoenixKitDocumentCreator.Variable{
  default: String.t() | nil,
  label: String.t(),
  name: String.t(),
  required: boolean(),
  type: variable_type()
}
```

# `variable_type`

```elixir
@type variable_type() :: :text | :date | :currency | :multiline
```

# `build_definitions`

```elixir
@spec build_definitions([String.t()]) :: [t()]
```

Builds Variable structs from a list of variable names, guessing types from names.

# `extract_variables`

```elixir
@spec extract_variables(term()) :: [String.t()]
```

Extracts variable names from text by scanning for `{{ variable_name }}` patterns.

Returns a sorted list of unique variable names (strings).

# `guess_type`

```elixir
@spec guess_type(String.t()) :: variable_type()
```

Guesses the variable type from its name.

# `humanize`

```elixir
@spec humanize(String.t()) :: String.t()
```

Converts an underscore_name to a human-readable label.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
