コード例 #1
0
  @Override
  public void renderOn(HtmlCanvas html) throws IOException {
    html.div()
        .a(href("#").onClick("$.previousVariant( this );"))
        .i(class_("icon-chevron-left"))
        ._i()
        ._a()
        .a(class_("pull-right").href("#").onClick("$.nextVariant( this );"))
        .i(class_("icon-chevron-right"))
        ._i()
        ._a()
        ._div()
        .div(class_("span4 ref-page"))
        .render(new PageRenderable(reviewId, comparison.getReference()))
        ._div()
        .div(class_("span4 new-page"))
        .render(new PageRenderable(reviewId, comparison.getMatch()))
        ._div()
        .div(class_("data-container span3"))
        .div(class_("cloud-tag"))
        .p(class_("data-container-title"))
        .i(class_("icon-tags"))
        ._i()
        .write("  Tags")
        ._p();
    if (comparison.getPageDifferencies().isEmpty()) {
      html.span(class_("label label-success no-changes")).write("change: none")._span();

    } else {
      if (comparison.getPageDifferencies().contains(PageDiffType.CONTENT)) {
        html.span(class_("label label-important content")).write("change: content")._span();
      }
      if (comparison.getPageDifferencies().contains(PageDiffType.LAYOUT)) {
        html.span(class_("label label-warning layout")).write("change: layout")._span();
      }
      if (comparison.getPageDifferencies().contains(PageDiffType.LOOK)) {
        html.span(class_("label label-warning look")).write("change: look")._span();
      }
      if (comparison.getPageDifferencies().contains(PageDiffType.TITLE)) {
        html.span(class_("label label-info title")).write("change: title")._span();
      }
      if (comparison.getPageDifferencies().contains(PageDiffType.URL)) {
        html.span(class_("label label-info url")).write("change: url")._span();
      }
    }

    html.span(class_("label label-info"))
        .write("o:title: ")
        .em()
        .write(comparison.getReference().getTitle())
        ._em()
        ._span()
        .span(class_("label label-info"))
        .write("n:title: ")
        .em()
        .write(comparison.getMatch().getTitle())
        ._em()
        ._span()
        .span(class_("label label-info"))
        .write("o:url: ")
        .em()
        .write(comparison.getReference().getUrl())
        ._em()
        ._span()
        .span(class_("label label-info"))
        .write("n:url: ")
        .em()
        .write(comparison.getMatch().getUrl())
        ._em()
        ._span();

    html._div();

    html._div();
  }
コード例 #2
0
  private static void createReadMe(List<SystemProperty> properties) throws IOException {
    HtmlCanvas html = new HtmlCanvas();
    html.table();

    html.tbody()
        .tr()
        .td()
        .content("Key")
        .td()
        .content("Description")
        .td()
        .content("Uses")
        ._tr()
        ._tbody();

    String githubUrl = "https://github.com/android/%s/blob/%s/%s";
    String branch = "lollipop-release";

    for (SystemProperty property : properties) {
      html.tr();
      html.td().content(property.key);
      html.td().content(property.desc);
      html.td();
      for (SystemProperty.GithubInfo o : property.github) {
        String url = String.format(githubUrl, o.repo, branch, o.path);
        html.a(href(url)).content(o.getClassName());
        html.br();
      }
      html._td();
      html._tr();
    }

    Files.write(Paths.get("README.md"), html.toHtml().getBytes());
  }
コード例 #3
0
ファイル: FancyHeader.java プロジェクト: zjsxcm/rendersnake
 public void renderOn(HtmlCanvas html) throws IOException {
   html.h1(style("font-style:italic"));
 }
コード例 #4
0
ファイル: FancyHeader.java プロジェクト: zjsxcm/rendersnake
 public void renderOn(HtmlCanvas html) throws IOException {
   html._h1();
 }
コード例 #5
0
ファイル: Link.java プロジェクト: zjsxcm/rendersnake
 public void renderOn(HtmlCanvas canvas) throws IOException {
   canvas.link(href(href).type(this.type).rel(rel));
 }