Uh oh!
There was an error while loading. Please reload this page.
- 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"intmain() {
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 structuredValuecompile_file(path)uses path as source and logical pathload_compiled_file(path)loads top-level.pbc