String baseStyleLink = builder.requireResource(getClass().getResource("/org/gradle/reporting/base-style.css"));
String reportJsLink = builder.requireResource(getClass().getResource("/org/gradle/reporting/report.js"));
String styleLink = builder.requireResource(getClass().getResource("style.css"));
SimpleHtmlWriter htmlWriter = builder.getOutput();
htmlWriter.startElement("head")
.startElement("meta").attribute("http-equiv", "Content-Type").attribute("content", "text/html; charset=utf-8").endElement()
.startElement("meta").attribute("http-equiv", "x-ua-compatible").attribute("content", "IE=edge").endElement()
.startElement("title").characters(getPageTitle()).endElement()
.startElement("link").attribute("href", baseStyleLink).attribute("rel", "stylesheet").attribute("type", "text/css").endElement()
.startElement("link").attribute("href", styleLink).attribute("rel", "stylesheet").attribute("type", "text/css").endElement()
.startElement("script").attribute("src", reportJsLink).attribute("type", "text/javascript").characters("").endElement() //html does not like <a name="..."/>
.endElement();
htmlWriter.startElement("body")
.startElement("div").attribute("id", "content")
.startElement("h1").characters(getTitle()).endElement();
getHeaderRenderer().render(model, htmlWriter);
getContentRenderer().render(model, htmlWriter);
htmlWriter.startElement("div").attribute("id", "footer")
.startElement("p").characters("Generated by ")
.startElement("a").attribute("href", "http://www.gradle.org").characters(String.format("Gradle %s", GradleVersion.current().getVersion())).endElement()
.characters(String.format(" at %s", builder.formatDate(new Date())))
.endElement()
.endElement()