Package-level declarations

Types

Link copied to clipboard
Link copied to clipboard
class DefaultAnnotatorSettings(val linkTextSpanStyle: TextLinkStyles, val codeSpanStyle: SpanStyle, val annotator: MarkdownAnnotator, val referenceLinkHandler: ReferenceLinkHandler? = null, val linkInteractionListener: LinkInteractionListener? = null) : AnnotatorSettings

Functions

Link copied to clipboard
fun annotatorSettings(linkTextSpanStyle: TextLinkStyles = LocalMarkdownTypography.current.textLink, codeSpanStyle: SpanStyle = LocalMarkdownTypography.current.codeSpanStyle, annotator: MarkdownAnnotator = LocalMarkdownAnnotator.current, referenceLinkHandler: ReferenceLinkHandler? = LocalReferenceLinkHandler.current, uriHandler: UriHandler = LocalUriHandler.current, linkInteractionListener: LinkInteractionListener? = LinkInteractionListener { link -> val annotationUrl = (link as? LinkAnnotation.Url)?.url if (annotationUrl != null) { val foundReference = referenceLinkHandler?.find(annotationUrl)?.takeIf { it.isNotEmpty() } ?: annotationUrl // wait for finger up to navigate to the link try { uriHandler.openUri(foundReference) } catch (t: Throwable) { println("Could not open the provided url: $foundReference // ${t.message}") } } }): AnnotatorSettings
Link copied to clipboard
fun AnnotatedString.Builder.appendAutoLink(content: String, node: ASTNode, annotatorSettings: AnnotatorSettings)

Appends an auto-detected link to the AnnotatedString.Builder.

Link copied to clipboard
fun AnnotatedString.Builder.appendMarkdownLink(content: String, node: ASTNode, annotatorSettings: AnnotatorSettings)

Appends a Markdown link to the AnnotatedString.Builder.

Link copied to clipboard
fun AnnotatedString.Builder.appendMarkdownReference(content: String, node: ASTNode, annotatorSettings: AnnotatorSettings)

Appends a Markdown reference to the AnnotatedString.Builder.

Link copied to clipboard
fun AnnotatedString.Builder.buildMarkdownAnnotatedString(content: String, children: List<ASTNode>, annotatorSettings: AnnotatorSettings)
fun AnnotatedString.Builder.buildMarkdownAnnotatedString(content: String, node: ASTNode, annotatorSettings: AnnotatorSettings)

Builds an AnnotatedString with the contents of the given Markdown ASTNode node.

fun String.buildMarkdownAnnotatedString(style: TextStyle, annotatorSettings: AnnotatorSettings, flavour: MarkdownFlavourDescriptor = GFMFlavourDescriptor()): AnnotatedString
fun String.buildMarkdownAnnotatedString(textNode: ASTNode, style: TextStyle, annotatorSettings: AnnotatorSettings): AnnotatedString
fun String.buildMarkdownAnnotatedString(style: TextStyle, linkTextSpanStyle: SpanStyle = style.toSpanStyle(), codeSpanStyle: SpanStyle = style.toSpanStyle(), flavour: MarkdownFlavourDescriptor = GFMFlavourDescriptor(), annotator: MarkdownAnnotator = markdownAnnotator(), referenceLinkHandler: ReferenceLinkHandler? = null, linkInteractionListener: LinkInteractionListener? = null): AnnotatedString

Extension function to build an AnnotatedString from a Markdown string. This function will parse the Markdown content and apply the given styles to the text.