return render;
}
private Element makeShowHtml(String file, String title, String contents) {
// create the pre tag
Element pre = new Element(Tag.valueOf("pre"), "");
pre.addClass("prettyprint source");
pre.attr("style", "overflow-x:auto");
List<Node> preChildren = new ArrayList<>();
if (contents != null) {
preChildren.add(new Element(Tag.valueOf("span"), "").appendText(contents));
}
ElementUtil.appendNodes(pre, preChildren);
// create the article tag
Element article = new Element(Tag.valueOf("article"), "");
List<Node> articleChildren = new ArrayList<>();
if (title == null) {
if (file != null) {
articleChildren.add(new Element(Tag.valueOf("div"), "").appendText(file));
}
} else {
articleChildren.add(new Element(Tag.valueOf("div"), "").appendText(title));
}
articleChildren.add(pre);
ElementUtil.appendNodes(article, articleChildren);
// create the section tag
Element section = new Element(Tag.valueOf("section"), "");
List<Node> sectionChildren = new ArrayList<>();
sectionChildren.add(article);
ElementUtil.appendNodes(section, sectionChildren);
return section;