<dependency> <groupId>org.snippetory</groupId> <artifactId>snippetory</artifactId> <version>RELEASE</version> </dependency> groovy implementation 'org.snippetory:snippetory:RELEASE' html <!DOCTYPE html> <html> <head> <title>{\$title}</title> </head> <body> <h1>{\$message}</h1> </body> </html> import org.snippetory.Template; import org.snippetory.TemplateContext; public class Main { public static void main(String[] args) { TemplateContext context = TemplateContext.newInstance("path/to/templates"); Template template = context.parse("template.html"); String output = template.toString(); System.out.println(output); } } html <!DOCTYPE html> <html> <head> </head> <body> </body> </html>


上一篇:
下一篇:
切换中文