MarkdownParserBuilder

A builder for creating markdown parsers with event-based handlers.

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
inner class MarkdownStreamingParser(parser: suspend (String) -> Unit)

Functions

Link copied to clipboard
fun build(): suspend (String) -> Unit

Creates a parser function that processes markdown text and returns a list of result objects.

Link copied to clipboard

Builds and returns a streaming markdown parser.

Link copied to clipboard
fun onBullet(handler: suspend (String) -> Unit)

Registers a handler for bullet points.

Link copied to clipboard
fun onCodeBlock(handler: suspend (String) -> Unit)

Registers a handler for code blocks.

Link copied to clipboard
fun onFinishStream(handler: suspend (String) -> Unit)

Registers a handler that is triggered when the stream processing is finished.

Link copied to clipboard
fun onHeader(level: Int, handler: suspend (String) -> Unit)

Registers a handler for headers of the specified level.

Link copied to clipboard
fun onLineMatching(regex: Regex?, handler: suspend (String) -> Unit)

Registers a handler that is triggered when a line matches the specified regex pattern. If no regex is provided, the handler will be called for every line.