Crow
Crow copied to clipboard
mustache features like parents, blocks and dynamic name does not seem to work
It seems that CrowCpp does not support the full mustache specification and this can be a problem. Specifically parents, blocks and dynamic names don't seem to be fully supported.
Parents and blocks
template1
<!DOCTYPE html>
<html>
<body >
<div class="ui segment">
{{$page_content}}
Placeholder
{{/page_content}}
</div>
</div>
</body>
</html>
template2
{{< template1}}
{{$page_content}}
<div class="ui placeholder segment">
This is what I want to replace the placeholder
</div>
{{/page_content}}
{{/template1}}
template 2 should render:
<!DOCTYPE html>
<html>
<body >
<div class="ui segment">
<div class="ui placeholder segment">
This is what I want to replace the placeholder
</div>
</div>
</div>
</body>
</html>
dynamic names:
template1
<!DOCTYPE html>
<html>
<body >
<div class="ui segment">
{{>*dynamic_page}}
</div>
</div>
</body>
</html>
template2
<div class="ui placeholder segment">
This would be interpolated if template2 is passed to dynamic_page at runtime
</div>
template3
<div class="ui placeholder segment">
This would be interpolated if template3 is passed to dynamic_page at runtime
</div>
hash
{
"dynamic_page" : "template2"
}
template 1 should render:
<!DOCTYPE html>
<html>
<body >
<div class="ui segment">
<div class="ui placeholder segment">
This would be interpolated if template2 is passed to dynamic_page at runtime
</div>
</div>
</div>
</body>
</html>