Class AsciiDocToText

java.lang.Object
pro.verron.asciidoc.converters.AsciiDocToText
All Implemented Interfaces:
Function<AsciiDocModel, String>

public final class AsciiDocToText extends Object implements Function<AsciiDocModel, String>

Converts an AsciiDocModel to a plain AsciiDoc text string.

Implements Function<AsciiDocModel, String> and renders headings, paragraphs, lists, tables, blockquotes, code blocks, images, inline elements (bold, italic, superscript, subscript, styled, links), and macros into their AsciiDoc text representation.

See Also:
  • Constructor Details

    • AsciiDocToText

      public AsciiDocToText(boolean skipComments)
      Constructs a converter that optionally skips comment blocks.
      Parameters:
      skipComments - whether to omit comment blocks in the output
  • Method Details

    • apply

      public String apply(AsciiDocModel model)
      Applies the conversion on the given AsciiDoc model and renders its blocks into a concatenated string representation.
      Specified by:
      apply in interface Function<AsciiDocModel, String>
      Parameters:
      model - the parsed AsciiDoc model
      Returns:
      the rendered AsciiDoc text