Package-level declarations

Types

Link copied to clipboard
fun interface BulletHandler

An interface of providing use case specific un/ordered list handling.

Link copied to clipboard
Link copied to clipboard
class DefaultMarkdownAnnotator(val annotate: AnnotatedString.Builder.(content: String, child: ASTNode) -> Boolean?, val config: MarkdownAnnotatorConfig) : MarkdownAnnotator
Link copied to clipboard
Link copied to clipboard
data class DefaultMarkdownColors(val text: Color, val codeBackground: Color, val inlineCodeBackground: Color, val dividerColor: Color, val tableBackground: Color) : MarkdownColors
Link copied to clipboard
data class DefaultMarkdownTypography(val h1: TextStyle, val h2: TextStyle, val h3: TextStyle, val h4: TextStyle, val h5: TextStyle, val h6: TextStyle, val text: TextStyle, val code: TextStyle, val inlineCode: TextStyle, val quote: TextStyle, val paragraph: TextStyle, val ordered: TextStyle, val bullet: TextStyle, val list: TextStyle, val textLink: TextLinkStyles, val table: TextStyle) : MarkdownTypography
Link copied to clipboard
data class ImageData(val painter: Painter, val modifier: Modifier = Modifier.fillMaxWidth(), val contentDescription: String? = "Image", val alignment: Alignment = Alignment.CenterStart, val contentScale: ContentScale = ContentScale.Fit, val alpha: Float = DefaultAlpha, val colorFilter: ColorFilter? = null)
Link copied to clipboard
Link copied to clipboard
data class Input(val content: String, val lookupLinks: Boolean, val flavour: MarkdownFlavourDescriptor, val parser: MarkdownParser, val referenceLinkHandler: ReferenceLinkHandler, val retainState: Boolean = false)

The input for the MarkdownState.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Interface for a state that handles the parsing of markdown content with the MarkdownParser.

Link copied to clipboard
Link copied to clipboard
data class PlaceholderConfig(val size: Size, val verticalAlign: PlaceholderVerticalAlign = PlaceholderVerticalAlign.Bottom)
Link copied to clipboard

Interface to describe the ReferenceLinkHandler

Link copied to clipboard

Implementation for ReferenceLinkHandler to resolve referenced link within the Markdown.

Link copied to clipboard
sealed interface State

The current state of the MarkdownState.

Functions

Link copied to clipboard
fun Flow<String>.asMarkdownState(lookupLinks: Boolean = true, retainState: Boolean = false, flavour: MarkdownFlavourDescriptor = GFMFlavourDescriptor(), parser: MarkdownParser = MarkdownParser(flavour), referenceLinkHandler: ReferenceLinkHandler = ReferenceLinkHandlerImpl()): Flow<State>

Transforms a Flow of markdown content strings into a Flow of parsed State for use in non-composable contexts like view models. As soon as the flow is collected, it will start parsing the content, and emit the state once ready.

Link copied to clipboard
fun markdownAnimations(animateTextSize: Modifier.() -> Modifier = { animateContentSize() }): MarkdownAnimations
Link copied to clipboard
fun markdownAnnotator(config: MarkdownAnnotatorConfig = markdownAnnotatorConfig(), annotate: AnnotatedString.Builder.(content: String, child: ASTNode) -> Boolean? = null): MarkdownAnnotator
Link copied to clipboard
Link copied to clipboard
fun markdownDimens(dividerThickness: Dp = 1.dp, codeBackgroundCornerSize: Dp = 8.dp, blockQuoteThickness: Dp = 2.dp, tableMaxWidth: Dp = Dp.Unspecified, tableCellWidth: Dp = 160.dp, tableCellPadding: Dp = 16.dp, tableCornerSize: Dp = 8.dp): MarkdownDimens
Link copied to clipboard
Link copied to clipboard
fun markdownPadding(block: Dp = 2.dp, list: Dp = 4.dp, listItemTop: Dp = 4.dp, listItemBottom: Dp = 4.dp, indentList: Dp? = null, listIndent: Dp = 8.dp, codeBlock: PaddingValues = PaddingValues(8.dp), blockQuote: PaddingValues = PaddingValues(horizontal = 16.dp, vertical = 0.dp), blockQuoteText: PaddingValues = PaddingValues(vertical = 4.dp), blockQuoteBar: PaddingValues.Absolute = PaddingValues.Absolute(left = 4.dp, top = 2.dp, right = 4.dp, bottom = 2.dp)): MarkdownPadding
Link copied to clipboard
fun parseMarkdownFlow(content: String, lookupLinks: Boolean = true, flavour: MarkdownFlavourDescriptor = GFMFlavourDescriptor(), parser: MarkdownParser = MarkdownParser(flavour), referenceLinkHandler: ReferenceLinkHandler = ReferenceLinkHandlerImpl()): Flow<State>

Creates a kotlinx.coroutines.flow.Flow of State for use in non-composable contexts like view models. As soon as the flow is collected, it will start parsing the content, and emit the state once ready.

Link copied to clipboard
fun rememberMarkdownState(vararg keys: Any?, lookupLinks: Boolean = true, retainState: Boolean = false, flavour: MarkdownFlavourDescriptor = remember { GFMFlavourDescriptor() }, parser: MarkdownParser = remember(flavour) { MarkdownParser(flavour) }, referenceLinkHandler: ReferenceLinkHandler = remember { ReferenceLinkHandlerImpl() }, block: suspend () -> String): MarkdownState

A MarkdownState that executes the parsing of the markdown content with the MarkdownParser asynchronously. This version accepts a suspend function block that returns the markdown content, allowing for dynamic loading.

fun rememberMarkdownState(content: String, lookupLinks: Boolean = true, retainState: Boolean = false, flavour: MarkdownFlavourDescriptor = remember { GFMFlavourDescriptor() }, parser: MarkdownParser = remember(flavour) { MarkdownParser(flavour) }, referenceLinkHandler: ReferenceLinkHandler = remember { ReferenceLinkHandlerImpl() }, immediate: Boolean = LocalInspectionMode.current): MarkdownState

A MarkdownState that executes the parsing of the markdown content with the MarkdownParser asynchronously.