Open kokujin opened 7 years ago
There is an example: https://github.com/spirit-js/examples#rendering-templates-with-jade
Is that ok? If it is not clear, let me know why so I can update the example or show more examples?
A template ends up being a string, so you just return the string. And the template libraries have their own compiling function that you can use.
Only complicated part is having caching, but that really depends on what you want the cache to do.
Also other libraries exist for working with different templates https://github.com/tj/consolidate.js Maybe I can show an example using that.
An example using consolidate would be great since it would cover several templating engines at the same time.
There is an example: https://github.com/spirit-js/examples#rendering-templates-with-jade
Is that ok? If it is not clear, let me know why so I can update the example or show more examples?
A template ends up being a string, so you just return the string. And the template libraries have their own compiling function that you can use.
Only complicated part is having caching, but that really depends on what you want the cache to do.
Also other libraries exist for working with different templates https://github.com/tj/consolidate.js Maybe I can show an example using that.