From a2e672d51fa21c722e44805f1dcf1ff911be1981 Mon Sep 17 00:00:00 2001 From: David Date: Thu, 23 Apr 2015 18:26:26 +0200 Subject: [PATCH] Update MainTemplateExample.java --- examples/MainTemplateExample.java | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/examples/MainTemplateExample.java b/examples/MainTemplateExample.java index 879efc7..26c693e 100644 --- a/examples/MainTemplateExample.java +++ b/examples/MainTemplateExample.java @@ -1,6 +1,6 @@ public class MainTemplate { - public static String render(String title, Tag... contentTags) { + public static String render(String title, Tag... tags) { return document().render() + html().with( head().with( @@ -12,7 +12,7 @@ public class MainTemplate { h1().withText(title) ), main().with( - contentTags //content from other template + tags //content from other template ), footer().withText("Footer text"), script().withSrc("https://code.jquery.com/jquery-2.1.3.min.js") @@ -25,7 +25,7 @@ public class MainTemplate { MainTemplate.render( "Form test", //this is the "String title" parameter - //Everything below here goes into the "Tag... contentTags" parameter + //Everything below here goes into the "Tag... tags" parameter // "..." means "varargs", which means you can add as many Tags as you like h2().withText("Please log in"), form().withMethod("post").with( @@ -36,7 +36,7 @@ MainTemplate.render( // you can create methods like these to return fully configured -// HTML input fields/buttons (or any other tag) +// HTML input fields/buttons (or any other kind of Tag) public static Tag emailInput(String placeholder) { return input() .withType("email") @@ -61,16 +61,13 @@ public static Tag submitButton(String text) { .withText(text); } -// OUTPUT -// If you call MainTemplate.render with the above setup, it will return this: -// Form test

Form test

Please log in

+// OUTPUT (unminified): -// Which unminified will look like this: // // // // Form test -// +// // // // @@ -80,8 +77,8 @@ public static Tag submitButton(String text) { //
//

Please log in

//
-// -// +// +// // //
//