X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2Fmstch%2Fmstch.cpp;fp=lib%2Fmstch%2Fmstch.cpp;h=4d84e97c582d2b71bf27f8c3520817ccd333271f;hb=2e142df11d6f312a2a2b5097b8da73571ed523e8;hp=0000000000000000000000000000000000000000;hpb=61b3659afe961ed248f30e26f9ca8f28fcfafddc;p=cpPlugins.git diff --git a/lib/mstch/mstch.cpp b/lib/mstch/mstch.cpp new file mode 100644 index 0000000..4d84e97 --- /dev/null +++ b/lib/mstch/mstch.cpp @@ -0,0 +1,20 @@ +#include + +#include "mstch/mstch.hpp" +#include "render_context.hpp" + +using namespace mstch; + +std::function mstch::config::escape; + +std::string mstch::render( + const std::string& tmplt, + const node& root, + const std::map& partials) +{ + std::map partial_templates; + for (auto& partial: partials) + partial_templates.insert({partial.first, {partial.second}}); + + return render_context(root, partial_templates).render(tmplt); +}