Data Binding

MarkCharm Team

September 8, 2026

1 Data-Driven Documents

MarkCharm can bind external data sources (JSON, YAML, TOML) directly into your document using the {$DATA} pragma.

1.1 How It Works

Place {$DATA filename.json} in the preamble. The compiler reads the file, flattens nested keys with underscores, and injects them as macros accessible via \key_name.

1.2 Bound Data from data.json

Property Value
Project MarkCharm
Version 0.74.0
License MIT
Tests Passed 1640
Coverage 92%

1.3 Using Bound Data in Text

The MarkCharm compiler (version 0.74.0) has 1640 tests passing with 92% code coverage. It is released under the MIT license.

1.4 Why Data Binding?

Data binding separates content from data, enabling:

1.5 Supported Formats

Format Extension Example
JSON .json {$DATA report.json}
YAML .yaml {$DATA config.yaml}
TOML .toml {$DATA settings.toml}