HtmlAnnotator
0.5.0-alphaindexedRenders HTML with CSS parsing capabilities, supporting custom tags, caching, and Jetpack Compose integration. Offers customizable parsers and handles various CSS sources seamlessly.
Renders HTML with CSS parsing capabilities, supporting custom tags, caching, and Jetpack Compose integration. Offers customizable parsers and handles various CSS sources seamlessly.
Translation: 中文
HtmlAnnotator is an HTML rendering library based on Kotlin Multiplatform and Compose Multiplatform, with support for parsing CSS styles. It also supports the Android View system.
text-align
font-size
font-weight
font-style
color
Published on mavenCentral
${LAST_VERSION}: (excluding 'v')
dependencies {
// Jetpack Compose extension support, providing out-of-the-box display components and caching mechanisms
implementation("io.github.ravenliao.htmlannotator:htmlAnnotator-compose-ext:${LAST_VERSION}")
// Basic support for Jetpack Compose
implementation("io.github.ravenliao.htmlannotator:htmlAnnotator-compose:${LAST_VERSION}")
// View
implementation("io.github.ravenliao.htmlannotator:htmlAnnotator-view:${LAST_VERSION}")
}
This library doesn't require any specific Proguard rules to be configured, but you may need to add Proguard configurations for indirect dependencies like Kotlin Coroutines and ksoup
Include htmlAnnotator-compose-ext and sketch
// Implement parsing of HTML documents with images
BasicHtmlImageText(
html = srcHtml,
imageContent = { imgUrl ->
AsyncImage(
uri = it,
contentDescription = "photo",
Modifier
.fillMaxWidth()
.wrapContentHeight(),
contentScale = ContentScale.FillWidth
)
}
)
For more details, see DemoScreen.
For the Android View implementation, refer to MainActivity.
Apache 2.0. For more details, see the LICENSE file.
background-color
text-indent
text-decoration
Surfaced from shared tags and platforms — no rankings paid for.