Class AsciiDocParser
java.lang.Object
pro.verron.asciidoc.core.AsciiDocParser
- All Implemented Interfaces:
Function<String, AsciiDocModel>
The AsciiDocParser class is a utility for parsing AsciiDoc-formatted text
and transforming it into structured models. It provides both static and
instance-based parsing capabilities and is designed to work with inline
structures within the text.
Methods
parse(String): A static method to parse an AsciiDoc string into anAsciiDocModel.apply(String): An instance method implementing theFunctioninterface for parsing an AsciiDoc string into anAsciiDocModel.
Internal Behavior
parseInlines(String): A private static helper method to parse inline elements from a given text input.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionProcesses an AsciiDoc-formatted string and converts it into anAsciiDocModel.static AsciiDocModelParses the given AsciiDoc string and produces anAsciiDocModel.
-
Constructor Details
-
AsciiDocParser
public AsciiDocParser()Constructs anAsciiDocParser.
-
-
Method Details
-
parse
Parses the given AsciiDoc string and produces anAsciiDocModel.- Parameters:
asciidoc- the AsciiDoc content to parse- Returns:
- an
AsciiDocModelrepresenting the parsed structure
-
apply
Processes an AsciiDoc-formatted string and converts it into an
AsciiDocModel.The resulting model contains structured blocks such as paragraphs, headings, lists, tables, images, code blocks, and blockquotes.
- Specified by:
applyin interfaceFunction<String, AsciiDocModel>- Parameters:
asciidoc- the AsciiDoc-formatted input string- Returns:
- an
AsciiDocModelrepresenting the parsed blocks; empty model if input is blank
-