From 8742a52c51c468760a5bbeb5bb8d0d83a1499401 Mon Sep 17 00:00:00 2001 From: mohamedmoanes Date: Fri, 23 Oct 2026 11:19:08 +0200 Subject: [PATCH 1/4] update read me --- .github/workflows/build-verification.yml | 2 ++ README.md | 37 +++++++++++++++++------- 2 files changed, 29 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-verification.yml b/.github/workflows/build-verification.yml index 295f86a..9b8780e 100644 --- a/.github/workflows/build-verification.yml +++ b/.github/workflows/build-verification.yml @@ -1,6 +1,8 @@ name: Build Verification on: + push: + branches: [main] pull_request: types: [opened, synchronize, reopened, ready_for_review] workflow_dispatch: diff --git a/README.md b/README.md index fc65f28..7f95b15 100644 --- a/README.md +++ b/README.md @@ -20,13 +20,18 @@ This library supports common Markdown syntax, including: * Horizontal rules * Images (rendered as text placeholder) +## Requirements + +* Android `minSdk` 24 +* Jetpack Compose. Compose Foundation is brought in by this library. + ## Installation -Add the dependency to your module's `build.gradle.kts`: +Add the dependency to your module's `build.gradle.kts`. `latest.release` resolves to the newest version on Maven Central, the same version shown by the Maven Central badge above. ```kotlin dependencies { - implementation("com.sumup.markdown:annotatedstring-generator:0.1.0") + implementation("com.sumup.markdown:annotatedstring-generator:latest.release") } ``` @@ -35,19 +40,15 @@ dependencies { ```groovy dependencies { - implementation 'com.sumup.markdown:annotatedstring-generator:0.1.0' + implementation 'com.sumup.markdown:annotatedstring-generator:latest.release' } ``` - -
Snapshot versions -To use a **snapshot** version (e.g., `0.1.0-SNAPSHOT`), add the Maven Central snapshots repository in your `settings.gradle.kts`: +Stable releases are published to Maven Central. To try an unpublished snapshot (for example `0.1.2-SNAPSHOT`), add the Maven Central snapshots repository in your `settings.gradle.kts`: ```kotlin dependencyResolutionManagement { @@ -63,16 +64,24 @@ Then use the snapshot version in your dependency: ```kotlin dependencies { - implementation("com.sumup.markdown:annotatedstring-generator:0.1.0-SNAPSHOT") + implementation("com.sumup.markdown:annotatedstring-generator:0.1.2-SNAPSHOT") } ```
## Usage +Imports: + +```kotlin +import com.sumup.markdown.annotatedstring.AnnotatedStringGenerator +import com.sumup.markdown.annotatedstring.CommonMarkFlavourDescriptor +import org.intellij.markdown.parser.MarkdownParser +``` + ### Basic Usage -Parse your markdown and generate an `AnnotatedString` in three lines: +Parse your markdown and generate an `AnnotatedString`: ```kotlin val markdown = "Hello **world**! This is *italic* and `code`." @@ -131,6 +140,8 @@ fun ClickableMarkdownText(markdown: String, modifier: Modifier = Modifier) { } ``` +The [`sample`](sample) module is a small Compose playground for the same API. + ## Building from Source To build the library from source, clone the repository and run the following command: @@ -153,6 +164,12 @@ To run the Paparazzi snapshot tests: ./gradlew :annotatedstring-generator:verifyPaparazziDebug ``` +## Project + +* [Changelog](CHANGELOG.md) +* [Contributing](CONTRIBUTING.md) +* [Security](SECURITY.md) + ## License ``` From d72f2654e6207ed8ec941a7dfc3d4413fefb6abe Mon Sep 17 00:00:00 2001 From: mohamedmoanes Date: Fri, 23 Oct 2026 12:41:32 +0200 Subject: [PATCH 2/4] update read me --- README.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 7f95b15..e4870a5 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ [![Maven Central](https://img.shields.io/maven-central/v/com.sumup.markdown/annotatedstring-generator)](https://central.sonatype.com/artifact/com.sumup.markdown/annotatedstring-generator) -A lightweight Android library to convert Markdown text into a Jetpack Compose `AnnotatedString`. This allows you to easily render formatted text from Markdown in your Compose UI. +A lightweight Android library to convert Markdown text into a Jetpack Compose `AnnotatedString`. Use `com.sumup.markdown:annotatedstring-generator` to produce one `AnnotatedString` for a Compose `Text` on Android (`minSdk` 24). This library is built on top of [JetBrains intellij-markdown](https://github.com/JetBrains/markdown), a multiplatform Markdown processor written in Kotlin. @@ -25,13 +25,17 @@ This library supports common Markdown syntax, including: * Android `minSdk` 24 * Jetpack Compose. Compose Foundation is brought in by this library. +## When to use this + +Use this library when Markdown should become one styled string inside a Compose `Text`. The parser is CommonMark through [JetBrains intellij-markdown](https://github.com/JetBrains/markdown). Links are a `"URL"` string annotation. Images are text placeholders. A `TextView`/`Spannable` library, or a renderer that emits a column of Compose nodes, fits a different layout. + ## Installation -Add the dependency to your module's `build.gradle.kts`. `latest.release` resolves to the newest version on Maven Central, the same version shown by the Maven Central badge above. +Add the dependency to your module's `build.gradle.kts`. The Maven Central badge above shows the latest published version. This snippet uses `0.1.1`. ```kotlin dependencies { - implementation("com.sumup.markdown:annotatedstring-generator:latest.release") + implementation("com.sumup.markdown:annotatedstring-generator:0.1.1") } ``` @@ -40,7 +44,7 @@ dependencies { ```groovy dependencies { - implementation 'com.sumup.markdown:annotatedstring-generator:latest.release' + implementation 'com.sumup.markdown:annotatedstring-generator:0.1.1' } ``` From 6c8feae56ae3a143cb9471bfdf59a2ffa29b49b8 Mon Sep 17 00:00:00 2001 From: mohamedmoanes Date: Fri, 23 Oct 2026 12:42:19 +0200 Subject: [PATCH 3/4] add llms.txt --- llms.txt | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 llms.txt diff --git a/llms.txt b/llms.txt new file mode 100644 index 0000000..a1c2bad --- /dev/null +++ b/llms.txt @@ -0,0 +1,19 @@ +# Markdown to AnnotatedString Generator + +> Android library that converts Markdown into one Jetpack Compose AnnotatedString for a Text. + +Use this when Markdown should become one styled string inside a Compose `Text`. The parser is CommonMark through JetBrains intellij-markdown. Links are a `"URL"` string annotation. Images are text placeholders. A `TextView`/`Spannable` library, or a renderer that emits a column of Compose nodes, fits a different layout. + +Android `minSdk` 24. Maven coordinates: `com.sumup.markdown:annotatedstring-generator:0.1.1`. + +```kotlin +val markdown = "Hello **world**! This is *italic* and `code`." +val flavour = CommonMarkFlavourDescriptor() +val parser = MarkdownParser(flavour) +val root = parser.buildMarkdownTreeFromString(markdown) +val annotatedString = AnnotatedStringGenerator(markdown, root, flavour).generateAnnotatedString() +``` + +## Docs + +- [README](https://github.com/sumup-oss/markdown-annotatedstring#readme): install snippets, Compose `Text` sample, and link-click handling From 75d36c7473eea729893f60aafe962564d5e20044 Mon Sep 17 00:00:00 2001 From: mohamedmoanes Date: Fri, 23 Oct 2026 12:43:31 +0200 Subject: [PATCH 4/4] update the meven description --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 715ba06..95e5539 100644 --- a/gradle.properties +++ b/gradle.properties @@ -27,7 +27,7 @@ GROUP=com.sumup.markdown VERSION_NAME=0.1.1 POM_ARTIFACT_ID=annotatedstring-generator POM_NAME=Markdown to AnnotatedString Generator -POM_DESCRIPTION=Android library to convert Markdown into Compose AnnotatedString +POM_DESCRIPTION=A lightweight Android library to convert Markdown text into a Jetpack Compose AnnotatedString. Use com.sumup.markdown:annotatedstring-generator to produce one AnnotatedString for a Compose Text on Android (minSdk 24). POM_URL=https://github.com/sumup-oss/markdown-annotatedstring # Provide these in CI as ORG_GRADLE_PROJECT_* environment variables.