> ## Documentation Index
> Fetch the complete documentation index at: https://docs.reelevant.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Template

> Apply template transformation using sprintf format

## Overview

The `template` transformation applies a template string with variable substitution using [sprintf](https://github.com/alexei/sprintf.js) format.

## Syntax

```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
template(<variable>, template="")
```

## Parameters

| Parameter  | Type   | Required | Description                                                                          |
| ---------- | ------ | -------- | ------------------------------------------------------------------------------------ |
| `variable` | any    | Yes      | The variable to use in the template                                                  |
| `template` | string | Yes      | The template string using sprintf format (e.g., `%s` for strings, `%d` for integers) |

## Examples

```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
template(<variable>, template="Hello %s!")
template(<variable>, template="Value: %d items")
```
