Skip to content
This repository has been archived by the owner on Oct 20, 2022. It is now read-only.

Commit

Permalink
Expose Utils::safeAnchorId as an Inja callback.
Browse files Browse the repository at this point in the history
  • Loading branch information
brycelelbach committed Dec 24, 2021
1 parent 187dc29 commit e05c642
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Doxybook/Renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ Doxybook2::Renderer::Renderer(const Config& config,
const auto arg = args.at(0)->get<std::string>();
return Utils::escape(arg);
});
env->add_callback("safeAnchorId", 1, [](inja::Arguments& args) -> std::string {
const auto arg = args.at(0)->get<std::string>();
return Utils::safeAnchorId(arg);
});
env->add_callback("title", 1, [](inja::Arguments& args) {
const auto arg = args.at(0)->get<std::string>();
return Utils::title(arg);
Expand Down

0 comments on commit e05c642

Please # to comment.