You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
532 B
C++
21 lines
532 B
C++
#include <iostream>
|
|
|
|
#include "mstch/mstch.hpp"
|
|
#include "render_context.hpp"
|
|
|
|
using namespace mstch;
|
|
|
|
std::function<std::string(const std::string&)> mstch::config::escape;
|
|
|
|
std::string mstch::render(
|
|
const std::string& tmplt,
|
|
const node& root,
|
|
const std::map<std::string,std::string>& partials)
|
|
{
|
|
std::map<std::string, template_type> partial_templates;
|
|
for (auto& partial: partials)
|
|
partial_templates.insert({partial.first, {partial.second}});
|
|
|
|
return render_context(root, partial_templates).render(tmplt);
|
|
}
|