private void render(DefinitionList node, NodeRendererContext context, final HtmlWriter html) { html.withAttr().tag("dl").indent(); context.renderChildren(node); html.unIndent().tag("/dl"); }
@Override public void renderDocument(final NodeRendererContext context, final HtmlWriter html, final Document document, final RenderingPhase phase) { if (phase == BODY_TOP) { // dump out the SVG used by the rest of the nodes HashSet<String> resolvedQualifiers = new HashSet<>(); Set<String> referencedQualifiers = new AdmonitionCollectingVisitor().collectAndGetQualifiers(document); for (String qualifier : referencedQualifiers) { String resolvedQualifier = this.options.qualifierTypeMap.get(qualifier); if (resolvedQualifier == null) resolvedQualifier = options.unresolvedQualifier; resolvedQualifiers.add(resolvedQualifier); } if (!resolvedQualifiers.isEmpty()) { html.line().attr("xmlns","http://www.w3.org/2000/svg").attr(Attribute.CLASS_ATTR, "adm-hidden").withAttr(ADMONITION_SVG_OBJECT_PART) .tag("svg").indent().line(); for (String info : resolvedQualifiers) { String svgContent = options.typeSvgMap.get(info); if (svgContent != null && !svgContent.isEmpty()) { html.raw("<symbol id=\"adm-").raw(info).raw("\">").indent().line() .raw("<svg enable-background=\"new 0 0 24 24\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">") .raw(svgContent).line() .unIndent().raw("</symbol>").line(); } } html.unIndent().closeTag("svg").line(); } } }
openedItems[lv + 1] = false; html.indent(); } else if (lastLevel == headerLevel) { if (i != 0) {
@SuppressWarnings("MethodMayBeStatic") void render(HtmlBlock node, NodeRendererContext context, HtmlWriter html) { html.line(); final HtmlRendererOptions htmlOptions = context.getHtmlOptions(); if (htmlOptions.sourceWrapHtmlBlocks) { html.srcPos(node.getChars()).withAttr(AttributablePart.NODE_POSITION).tag("div").indent().line(); } if (node.hasChildren()) { // inner blocks handle rendering context.renderChildren(node); } else { renderHtmlBlock(node, context, html, htmlOptions.suppressHtmlBlocks, htmlOptions.escapeHtmlBlocks, false); } if (htmlOptions.sourceWrapHtmlBlocks) { html.unIndent().tag("/div"); } html.lineIf(htmlOptions.htmlBlockCloseTagEol); }
public static void renderHtmlToc(HtmlWriter html, BasedSequence sourceText, List<Heading> headings, List<String> headingTexts, TocOptions tocOptions) { if (headings.size() > 0 && (sourceText.isNotNull() || !tocOptions.title.isEmpty())) { if (sourceText.isNotNull()) html.srcPos(sourceText); html.attr(Attribute.CLASS_ATTR, tocOptions.divClass).withAttr(TOC_CONTENT).tag("div").line().indent(); html.tag("h" + tocOptions.titleLevel).text(tocOptions.title).tag("/h" + tocOptions.titleLevel).line(); initLevel = headerLevel; lastLevel = headerLevel; html.attr(Attribute.CLASS_ATTR, tocOptions.listClass).withAttr(TOC_LIST).line().tag(listOpen).indent().line(); openedList[0] = true; html.withAttr().indent().line().tag(listOpen).indent(); openedList[lastLevel] = true;
case DEFINITION_LIST: html.tagVoidLine("hr"); html.tag("dl").indent();
html.srcPos(node.getChars()).withAttr(AttributablePart.NODE_POSITION).tag("div").indent().line(); context.renderChildren(macroDefinitionBlock); html.unIndent().tag("/div");
private void render(DefinitionList node, NodeRendererContext context, final HtmlWriter html) { html.withAttr().tag("dl").indent(); context.renderChildren(node); html.unIndent().tag("/dl"); }
openedItems[lv + 1] = false; html.indent(); } else if (lastLevel == headerLevel) { if (i != 0) {
@SuppressWarnings("MethodMayBeStatic") void render(HtmlBlock node, NodeRendererContext context, HtmlWriter html) { html.line(); final HtmlRendererOptions htmlOptions = context.getHtmlOptions(); if (htmlOptions.sourceWrapHtmlBlocks) { html.srcPos(node.getChars()).withAttr(AttributablePart.NODE_POSITION).tag("div").indent().line(); } if (node.hasChildren()) { // inner blocks handle rendering context.renderChildren(node); } else { renderHtmlBlock(node, context, html, htmlOptions.suppressHtmlBlocks, htmlOptions.escapeHtmlBlocks, false); } if (htmlOptions.sourceWrapHtmlBlocks) { html.unIndent().tag("/div"); } html.lineIf(htmlOptions.htmlBlockCloseTagEol); }
public static void renderHtmlToc(HtmlWriter html, BasedSequence sourceText, List<Heading> headings, List<String> headingTexts, TocOptions tocOptions) { if (headings.size() > 0 && (sourceText.isNotNull() || !tocOptions.title.isEmpty())) { if (sourceText.isNotNull()) html.srcPos(sourceText); html.attr(Attribute.CLASS_ATTR, tocOptions.divClass).withAttr(TOC_CONTENT).tag("div").line().indent(); html.tag("h" + tocOptions.titleLevel).text(tocOptions.title).tag("/h" + tocOptions.titleLevel).line(); initLevel = headerLevel; lastLevel = headerLevel; html.attr(Attribute.CLASS_ATTR, tocOptions.listClass).withAttr(TOC_LIST).line().tag(listOpen).indent().line(); openedList[0] = true; html.withAttr().indent().line().tag(listOpen).indent(); openedList[lastLevel] = true;
case DEFINITION_LIST: html.tagVoidLine("hr"); html.tag("dl").indent();