Package-level declarations

Types

Link copied to clipboard

Maps offsets in raw extracted content (paragraph/heading text after whitespace stripping) back to absolute document positions.

Link copied to clipboard
data class Span(val type: TokenType, val start: Int, val end: Int)

A half-open source range [start, end) annotated with a TokenType.

Link copied to clipboard
class SpanSink

A mutable accumulator for Spans, used as the U (user context) type parameter when running a parser in highlighting mode.

Link copied to clipboard
sealed interface TokenType

The semantic type of a highlighted span in a CommonMark document.

Functions

Link copied to clipboard
fun SpanSink.emit(type: TokenType, start: Int, end: Int)

Emits a Span into this SpanSink if the range is non-empty.

Link copied to clipboard

Scans a markdown document and returns a flat list of Spans with absolute document offsets for syntax highlighting.