Skip to content

Instantly share code, notes, and snippets.

@LudgerPeters
Last active August 29, 2015 14:19
Show Gist options
  • Select an option

  • Save LudgerPeters/4bd42dbfe9d3d1334a11 to your computer and use it in GitHub Desktop.

Select an option

Save LudgerPeters/4bd42dbfe9d3d1334a11 to your computer and use it in GitHub Desktop.
ApplicationController/index.rocker.html
@import controllers.ApplicationController
@args (String title)
<!DOCTYPE html>
<html lang="en">
<head>
<title>@title</title>
<link rel='stylesheet' href='@N.webJarsAt("bootstrap/3.3.2-1/css/bootstrap.min.css")'>
<link rel='stylesheet' href='@N.assetsAt("css/app.css")'>
</head>
<body>
Hi!
<a href='@N.reverseRoute(ApplicationController.class, "index")'/>Home</a>
</body>
<script type="text/javascript">
@if (N.isProd()) {
/* production-only code (e.g. google analytics) */
}
</script>
</html>
package views.ApplicationController;
import java.io.IOException;
import com.fizzed.rocker.ContentType;
import com.fizzed.rocker.ForIterator;
import com.fizzed.rocker.RenderingException;
import com.fizzed.rocker.RockerContent;
import com.fizzed.rocker.runtime.PlainTextUnloadedClassLoader;
// import @ [1:1]
import controllers.ApplicationController;
/*
* Auto generated code to render template views/ApplicationController/index.rocker.html
* Do not edit this file. Changes will eventually be overwritten by Rocker parser!
*/
public class index extends com.fizzed.rocker.runtime.DefaultRockerTemplate<index> {
// <!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <title>
static private final byte[] PLAIN_TEXT_0_0;
// </title>\n <link rel='stylesheet' href='
static private final byte[] PLAIN_TEXT_1_0;
// '>\n <link rel='stylesheet' href='
static private final byte[] PLAIN_TEXT_2_0;
// '>\n</head>\n<body>\nHi!\n<a href='
static private final byte[] PLAIN_TEXT_3_0;
// '/>Home</a>\n</body>\n<script type=\"text/javascript\">\n
static private final byte[] PLAIN_TEXT_4_0;
// /* production-only code (e.g. google analytics) */\n
static private final byte[] PLAIN_TEXT_5_0;
// </script>\n</html>
static private final byte[] PLAIN_TEXT_6_0;
static {
PlainTextUnloadedClassLoader loader = PlainTextUnloadedClassLoader.tryLoad(index.class.getName() + "$PlainText", "UTF-8");
PLAIN_TEXT_0_0 = loader.tryGet("PLAIN_TEXT_0_0");
PLAIN_TEXT_1_0 = loader.tryGet("PLAIN_TEXT_1_0");
PLAIN_TEXT_2_0 = loader.tryGet("PLAIN_TEXT_2_0");
PLAIN_TEXT_3_0 = loader.tryGet("PLAIN_TEXT_3_0");
PLAIN_TEXT_4_0 = loader.tryGet("PLAIN_TEXT_4_0");
PLAIN_TEXT_5_0 = loader.tryGet("PLAIN_TEXT_5_0");
PLAIN_TEXT_6_0 = loader.tryGet("PLAIN_TEXT_6_0");
}
// argument @ [3:6]
protected String title;
public index() {
super();
__internal.setCharset("UTF-8");
__internal.setContentType(ContentType.HTML);
__internal.setTemplateName("index.rocker.html");
__internal.setTemplatePackageName("views.ApplicationController");
}
public index title(String title) {
this.title = title;
return this;
}
static public index template(String title) {
return new index()
.title(title);
}
@Override
protected void __render() throws IOException, RenderingException {
// PlainText
__internal.aboutToExecutePosInTemplate(3, 21);
__internal.writeValue(PLAIN_TEXT_0_0);
// ValueExpression
__internal.aboutToExecutePosInTemplate(8, 12);
__internal.renderValue(title);
// PlainText
__internal.aboutToExecutePosInTemplate(8, 18);
__internal.writeValue(PLAIN_TEXT_1_0);
// ValueExpression
__internal.aboutToExecutePosInTemplate(9, 34);
__internal.renderValue(N.webJarsAt("bootstrap/3.3.2-1/css/bootstrap.min.css"));
// PlainText
__internal.aboutToExecutePosInTemplate(9, 89);
__internal.writeValue(PLAIN_TEXT_2_0);
// ValueExpression
__internal.aboutToExecutePosInTemplate(10, 34);
__internal.renderValue(N.assetsAt("css/app.css"));
// PlainText
__internal.aboutToExecutePosInTemplate(10, 60);
__internal.writeValue(PLAIN_TEXT_3_0);
// ValueExpression
__internal.aboutToExecutePosInTemplate(14, 10);
__internal.renderValue(N.reverseRoute(ApplicationController.class, "index"));
// PlainText
__internal.aboutToExecutePosInTemplate(14, 63);
__internal.writeValue(PLAIN_TEXT_4_0);
// IfBlockBegin
__internal.aboutToExecutePosInTemplate(17, 1);
if (N.isProd()) {
// PlainText
__internal.aboutToExecutePosInTemplate(17, 19);
__internal.writeValue(PLAIN_TEXT_5_0);
// IfBlockEnd
__internal.aboutToExecutePosInTemplate(17, 1);
} // if end @ [17:1]
// PlainText
__internal.aboutToExecutePosInTemplate(19, 2);
__internal.writeValue(PLAIN_TEXT_6_0);
}
private static class PlainText {
static private final String PLAIN_TEXT_0_0 = "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <title>";
static private final String PLAIN_TEXT_1_0 = "</title>\n <link rel='stylesheet' href='";
static private final String PLAIN_TEXT_2_0 = "'>\n <link rel='stylesheet' href='";
static private final String PLAIN_TEXT_3_0 = "'>\n</head>\n<body>\nHi!\n<a href='";
static private final String PLAIN_TEXT_4_0 = "'/>Home</a>\n</body>\n<script type=\"text/javascript\">\n";
static private final String PLAIN_TEXT_5_0 = " /* production-only code (e.g. google analytics) */\n";
static private final String PLAIN_TEXT_6_0 = "</script>\n</html>";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment