Toast Engine
Loading...
Searching...
No Matches
document_preprocess.hpp File Reference

Prepares .rml text before it reaches RmlUi. More...

#include <functional>
#include <optional>
#include <string>
#include <string_view>
#include <toast/export.hpp>
#include <vector>
Include dependency graph for document_preprocess.hpp:

Go to the source code of this file.

Classes

struct  ui::PreprocessContext
struct  ui::DocumentScan

Typedefs

using ui::ColorResolver = std::function<std::optional<std::string>(std::string_view)>

Functions

auto ui::resolveColorReferences (std::string_view source, const ColorResolver &resolver) -> std::string
 Scans and transforms a document before RmlUi parses it.

Detailed Description

Prepares .rml text before it reaches RmlUi.

Author
Xein
Date
18 Jul 2026

Function Documentation

◆ resolveColorReferences()

auto TOAST_API ui::resolveColorReferences ( std::string_view source,
const ColorResolver & resolver ) -> std::string

Scans and transforms a document before RmlUi parses it.

Injects <link type="text/rcss"> tags for the given VFS style URIs

Ccollects data binding names from data-* attributes and {{ }} expressions

Ccollects event handler names from 1data-event-* and on*` attributes

Tags <body> with the shared data-model */ auto TOAST_API preprocessDocument(std::string_view rml, const PreprocessContext& ctx) -> DocumentScan;

/**

Replaces ${color:name} references before RmlUi parses RML or RCSS

Scheme colors become #RRGGBBAA