Register a JavaScript helper function
<mrdocs/Support/JavaScript.hpp>
Expected<void, Error>
registerHelper(
mrdocs::Handlebars& hbs,
std::string_view name,
Context& ctx,
std::string_view script);
This function registers a JavaScript function as a helper function that can be called from Handlebars templates.
| Name | Description |
|---|---|
| hbs | The Handlebars instance to register the helper into |
| name | The name of the helper function |
| ctx | The JavaScript context to use |
| script | The JavaScript code that defines the helper function |