-
Notifications
You must be signed in to change notification settings - Fork 0
C++ API
Leonard Ramminger edited this page May 14, 2026
·
1 revision
#include "PrebyteEngine.h"
int main() {
prebyte::Prebyte prebyte;
prebyte.set_variable("name", "Ada");
prebyte.add_argument("first-extra");
std::string output = prebyte.process("Hello {{ name }}\n");
}#include "Engine.h"
prebyte::Engine engine;
prebyte::CompiledTemplate tpl = engine.compile("Hello {{ name }}\n");
prebyte::RenderContext ctx;
ctx.set("name", "Ada");
std::string output = engine.render(tpl, ctx);-
render()wrapsrender_to() -
RenderContextsupports scalar and structuredValue -
compile_file(path)uses path as source and logical path -
load_compiled_file(path)loads top-level.pbc