private void processAsciiDoc(ParserContext context) { Options options = getAsciiDocOptionsAndAttributes(context); final Asciidoctor asciidoctor = getEngine(options); context.setBody(asciidoctor.render(context.getBody(), options)); }
@Override public String render(String text) { String textToRender = Optional.ofNullable(text).orElse(""); return Optional.ofNullable( getAsciidoctor().render(addAsciidocLineBreaks(textToRender), getOptions()) ).orElse(""); }
/** * Renders the input using Asciidoctor. * * The source is first cleaned by stripping any trailing space after an * end line (e.g., `"\n "`), which gets left behind by the Javadoc * processor. * * @param input AsciiDoc source * @return content rendered by Asciidoctor */ private String render(String input, boolean inline) { if (input.trim().isEmpty()) { return ""; } options.setDocType(inline ? INLINE_DOCTYPE : null); return asciidoctor.render(cleanJavadocInput(input), options); }
@Override public String render(String text) { return getAsciidoctor().render(addAsciidocLineBreaks(text), getOptions()); }
@Override public String render(String text) { return getAsciidoctor().render(addAsciidocLineBreaks(text), getOptions()); }
private void processAsciiDoc(ParserContext context) { Options options = getAsciiDocOptionsAndAttributes(context); final Asciidoctor asciidoctor = getEngine(options); context.setBody(asciidoctor.render(context.getBody(), options)); }
@Override public String convertAsciiDocToXHtml(final String asciiDoc) { LOG.info("Converting AsciiDoc to XHTML5..."); final Asciidoctor asciidoctor = create(); final Map<String, Object> attributes = AttributesBuilder.attributes() .unsetStyleSheet() .tableOfContents(Placement.TOP) .asMap(); final Map<String, Object> options = OptionsBuilder.options() .attributes(attributes) .backend("xhtml5") .asMap(); LOG.info("XHTML5 Conversion Complete!"); return asciidoctor.render(asciiDoc, options); }
asciidoctor.render(wrap(title, version, source), optionsBuilder);