Skip to content

Commit db49977

Browse files
authored
Merge pull request #258 from mikepenz/develop
dev -> main
2 parents ba99571 + ea34dfa commit db49977

File tree

46 files changed

+647
-202
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+647
-202
lines changed

.github/config/configuration.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
{
2222
"title": "## 💬 Other",
2323
"labels": [
24-
"other"
24+
"other",
25+
"dependencies"
2526
]
2627
}
2728
]

.github/dependabot.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"

.github/workflows/ci.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties
3535

3636
- name: Setup Gradle
37-
uses: gradle/actions/setup-gradle@v3
37+
uses: gradle/actions/setup-gradle@v4
3838

3939
- name: Cache konan
4040
uses: actions/cache@v4
@@ -75,13 +75,13 @@ jobs:
7575
java-version: '17'
7676

7777
- name: Validate gradle wrapper
78-
uses: gradle/actions/wrapper-validation@v3
78+
uses: gradle/actions/wrapper-validation@v4
7979

8080
- name: Copy CI gradle.properties
8181
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties
8282

8383
- name: Setup Gradle
84-
uses: gradle/actions/setup-gradle@v3
84+
uses: gradle/actions/setup-gradle@v4
8585

8686
- name: Build Debug
8787
run: |
@@ -94,7 +94,7 @@ jobs:
9494
9595
- name: Publish Test Report
9696
if: (failure() || success()) && github.event_name == 'pull_request'
97-
uses: mikepenz/action-junit-report@v4
97+
uses: mikepenz/action-junit-report@v5
9898
with:
9999
report_paths: '**/app/build/test-results/validateDebugScreenshotTest/TEST-*.xml'
100100
github_token: ${{ secrets.GITHUB_TOKEN }}
@@ -161,7 +161,7 @@ jobs:
161161

162162
- name: Build Changelog
163163
id: github_release
164-
uses: mikepenz/release-changelog-builder-action@v4
164+
uses: mikepenz/release-changelog-builder-action@v5
165165
if: startsWith(github.ref, 'refs/tags/')
166166
with:
167167
configuration: ".github/config/configuration.json"

.github/workflows/gradle-dependency-submission.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ jobs:
2525
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties
2626

2727
- name: Setup Gradle & Submit dependency graphs
28-
uses: gradle/actions/setup-gradle@v3
28+
uses: gradle/actions/setup-gradle@v4
2929
with:
3030
dependency-graph: generate-and-submit

.github/workflows/static.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ jobs:
3232
- name: Checkout
3333
uses: actions/checkout@v4
3434
- name: Setup Pages
35-
uses: actions/configure-pages@v4
35+
uses: actions/configure-pages@v5
3636
- uses: actions/setup-java@v4
3737
with:
3838
distribution: 'zulu'
3939
java-version: |
4040
11
4141
17
4242
- name: Setup Gradle
43-
uses: gradle/actions/setup-gradle@v3
43+
uses: gradle/actions/setup-gradle@v4
4444
- name: Build Page
4545
run: |
4646
./gradlew app-wasm:wasmJsBrowserDistribution --no-configuration-cache

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,19 @@ Markdown(
122122
)
123123
```
124124

125+
### Disable Animation
126+
127+
By default, the `MarkdownText` animates size changes (if images are loaded).
128+
129+
```kotlin
130+
Markdown(
131+
content,
132+
animations = markdownAnimations(
133+
animateTextSize = { this /** No animation */ }
134+
),
135+
}
136+
```
137+
125138
### Extended spans
126139

127140
Starting with 0.16.0 the library includes support
@@ -262,6 +275,21 @@ Markdown(
262275
)
263276
```
264277

278+
### Table Support
279+
280+
Starting with 0.30.0, the library includes support for rendering tables in markdown. The `Markdown` composable will automatically handle table elements in your markdown content.
281+
282+
```kotlin
283+
val markdown = """
284+
| Header 1 | Header 2 |
285+
|----------|----------|
286+
| Cell 1 | Cell 2 |
287+
| Cell 3 | Cell 4 |
288+
""".trimIndent()
289+
290+
Markdown(markdown)
291+
```
292+
265293
</p>
266294
</details>
267295

app-wasm/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl
1+
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl
22

33
plugins {
44
kotlin("multiplatform")

app/src/screenshotTest/kotlin/com.mikepenz.markdown.ui/SnapshotTests.kt

Lines changed: 56 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,39 @@
11
package com.mikepenz.markdown.ui
22

3+
import android.content.res.Configuration
34
import android.graphics.Color
5+
import androidx.compose.foundation.isSystemInDarkTheme
46
import androidx.compose.runtime.Composable
57
import androidx.compose.ui.tooling.preview.Preview
68
import com.mikepenz.markdown.m2.Markdown
79

810
class SnapshotTests {
911
@Preview(showBackground = true, backgroundColor = Color.WHITE.toLong(), heightDp = 1750)
12+
@Preview(showBackground = true, backgroundColor = Color.BLACK.toLong(), heightDp = 1750, uiMode = Configuration.UI_MODE_NIGHT_YES)
1013
@Composable
11-
fun DefaultTest() = TestThemeSetup {
12-
Markdown(MARKDOWN_DEFAULT)
13-
}
14-
15-
@Preview(showBackground = true, backgroundColor = Color.BLACK.toLong(), heightDp = 1750)
16-
@Composable
17-
fun DefaultDarkTest() = TestThemeSetup(true) {
14+
fun DefaultTest() = SampleTheme(isSystemInDarkTheme()) {
1815
Markdown(MARKDOWN_DEFAULT)
1916
}
2017

2118
@Preview(showBackground = true, backgroundColor = Color.WHITE.toLong(), heightDp = 1000)
19+
@Preview(showBackground = true, backgroundColor = Color.BLACK.toLong(), heightDp = 1000, uiMode = Configuration.UI_MODE_NIGHT_YES)
2220
@Composable
23-
fun RandomTest() = TestThemeSetup {
24-
Markdown(MARKDOWN_RANDOM)
25-
}
26-
27-
@Preview(showBackground = true, backgroundColor = Color.BLACK.toLong(), heightDp = 1000)
28-
@Composable
29-
fun RandomDarkTest() = TestThemeSetup(true) {
21+
fun RandomTest() = SampleTheme(isSystemInDarkTheme()) {
3022
Markdown(MARKDOWN_RANDOM)
3123
}
3224

3325
@Preview(showBackground = true, backgroundColor = Color.WHITE.toLong(), heightDp = 380)
26+
@Preview(showBackground = true, backgroundColor = Color.BLACK.toLong(), heightDp = 380, uiMode = Configuration.UI_MODE_NIGHT_YES)
3427
@Composable
35-
fun ListCodeBlockTest() = TestThemeSetup {
28+
fun ListCodeBlockTest() = SampleTheme(isSystemInDarkTheme()) {
3629
Markdown(MARKDOWN_LIST_CODE_BLOCK)
3730
}
3831

39-
/**Helper to have a single place setting up the theme*/
32+
@Preview(showBackground = true, backgroundColor = Color.WHITE.toLong(), heightDp = 1250)
33+
@Preview(showBackground = true, backgroundColor = Color.BLACK.toLong(), heightDp = 1250, uiMode = Configuration.UI_MODE_NIGHT_YES)
4034
@Composable
41-
private fun TestThemeSetup(dark: Boolean = false, block: @Composable () -> Unit) {
42-
SampleTheme(dark) {
43-
block()
44-
}
35+
fun TableTest() = SampleTheme(isSystemInDarkTheme()) {
36+
Markdown(MARKDOWN_TABLE)
4537
}
4638
}
4739

@@ -149,4 +141,48 @@ private val MARKDOWN_LIST_CODE_BLOCK = """
149141
```
150142
- Sub-subitem 2
151143
- Subitem 3
144+
""".trimIndent()
145+
146+
private val MARKDOWN_TABLE = """
147+
// simple table
148+
149+
| First Header | Second Header |
150+
| ------------- | ------------- |
151+
| Content Cell | Content Cell |
152+
| Content Cell | Content Cell |
153+
154+
// simple table with long rows
155+
156+
| Command | Description |
157+
| --- | --- |
158+
| git status | List all new or modified files |
159+
| git diff | Show file differences that haven't been staged |
160+
161+
// formatting table content
162+
163+
| Command | Description |
164+
| --- | --- |
165+
| `git status` | List all *new or modified* files |
166+
| `git diff` | Show file differences that **haven't been** staged |
167+
168+
// alignment - not supported as of yet
169+
170+
| Left-aligned | Center-aligned | Right-aligned |
171+
| :--- | :---: | ---: |
172+
| git status | git status | git status |
173+
| git diff | git diff | git diff |
174+
175+
// special content
176+
177+
| Name | Character |
178+
| --- | --- |
179+
| Backtick | ` |
180+
| Pipe | \| |
181+
182+
// incorrect columns
183+
184+
| abc | def |
185+
| --- | --- |
186+
| bar |
187+
| bar | baz | boo |
152188
""".trimIndent()

gradle.properties

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Maven stuff
22
GROUP=com.mikepenz
3-
VERSION_NAME=0.27.0
4-
VERSION_CODE=2700
3+
VERSION_NAME=0.28.0
4+
VERSION_CODE=2800
55

66
POM_URL=https://github.com/mikepenz/multiplatform-markdown-renderer
77

@@ -37,4 +37,9 @@ org.jetbrains.compose.experimental.uikit.enabled=true
3737
org.jetbrains.compose.experimental.jscanvas.enabled=true
3838
org.jetbrains.compose.experimental.macos.enabled=true
3939

40-
android.experimental.enableScreenshotTest=true
40+
# Screenshot test
41+
android.experimental.enableScreenshotTest=true
42+
43+
# Dokka
44+
org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled
45+
org.jetbrains.dokka.experimental.gradle.pluginMode.noWarn=true

gradle/libs.versions.toml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
[versions]
22
agp = "8.7.2"
3-
compileSdk = "34"
3+
compileSdk = "35"
44
minSdk = "21"
5-
targetSdk = "34"
5+
targetSdk = "35"
66
androidx-activityCompose = "1.9.3"
77
androidx-material = "1.12.0"
88
compose = "1.7.5"
9-
compose-plugin = "1.7.0"
9+
compose-plugin = "1.7.1"
1010
kotlin = "2.0.21"
11-
coroutines = "1.9.0"
11+
coroutines = "1.10.1"
1212
dokka = "2.0.0-Beta"
13-
coil = "3.0.0-rc02"
13+
coil = "3.0.4"
1414
coil2 = "2.7.0"
15-
aboutlib = "11.2.3"
15+
aboutlib = "11.3.0-rc01"
1616
markdown = "0.7.3"
1717
detekt = "1.23.7"
1818
gradleMvnPublish = "0.30.0"
19-
screenshot = "0.0.1-alpha07"
19+
screenshot = "0.0.1-alpha08"
2020
ktor = "3.0.1"
21-
highlights = "0.9.3"
21+
highlights = "1.0.0"
2222

2323
[libraries]
2424
androidx-material = { group = "com.google.android.material", name = "material", version.ref = "androidx-material" }

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

gradlew

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,7 @@ done
8686
# shellcheck disable=SC2034
8787
APP_BASE_NAME=${0##*/}
8888
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
89-
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
90-
' "$PWD" ) || exit
89+
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
9190

9291
# Use the maximum available, or set MAX_FD != -1 to use that value.
9392
MAX_FD=maximum

kotlin-js-store/yarn.lock

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -118,14 +118,19 @@
118118
"@types/estree" "*"
119119

120120
"@types/eslint@*":
121-
version "8.56.10"
122-
resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-8.56.10.tgz#eb2370a73bf04a901eeba8f22595c7ee0f7eb58d"
123-
integrity sha512-Shavhk87gCtY2fhXDctcfS3e6FdxWkCx1iUZ9eEUbh7rTqlZT0/IzOkCOVt0fCjcFuZ9FPYfuezTBImfHCDBGQ==
121+
version "9.6.1"
122+
resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-9.6.1.tgz#d5795ad732ce81715f27f75da913004a56751584"
123+
integrity sha512-FXx2pKgId/WyYo2jXw63kk7/+TY7u7AziEJxJAnSFzHlqTAS3Ync6SvgYAN/k4/PQpnnVuzoMuVnByKK2qp0ag==
124124
dependencies:
125125
"@types/estree" "*"
126126
"@types/json-schema" "*"
127127

128-
"@types/estree@*", "@types/estree@^1.0.5":
128+
"@types/estree@*":
129+
version "1.0.6"
130+
resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.6.tgz#628effeeae2064a1b4e79f78e81d87b7e5fc7b50"
131+
integrity sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==
132+
133+
"@types/estree@^1.0.5":
129134
version "1.0.5"
130135
resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.5.tgz#a6ce3e556e00fd9895dd872dd172ad0d4bd687f4"
131136
integrity sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==
@@ -909,9 +914,9 @@ engine.io@~6.5.2:
909914
ws "~8.11.0"
910915

911916
enhanced-resolve@^5.17.0:
912-
version "5.17.1"
913-
resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.17.1.tgz#67bfbbcc2f81d511be77d686a90267ef7f898a15"
914-
integrity sha512-LMHl3dXhTcfv8gM4kEzIUeTQ+7fpdA0l2tUf34BddXPkz2A5xJ5L/Pchd5BL6rdccM9QGvu0sWZzK1Z1t4wwyg==
917+
version "5.18.0"
918+
resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.18.0.tgz#91eb1db193896b9801251eeff1c6980278b1e404"
919+
integrity sha512-0/r0MySGYG8YqlayBZ6MuCfECmHFdJ5qyPh8s8wa5Hnm6SaFLSK1VYCbj+NKp090Nm1caZhD+QTnmxO7esYGyQ==
915920
dependencies:
916921
graceful-fs "^4.2.4"
917922
tapable "^2.2.0"

multiplatform-markdown-renderer-code/build.gradle.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import com.vanniktech.maven.publish.SonatypeHost
2+
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl
23
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
3-
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl
44

55
plugins {
66
kotlin("multiplatform")
@@ -145,10 +145,10 @@ dependencies {
145145
commonMainApi(libs.highlights)
146146
}
147147

148-
tasks.dokkaHtml.configure {
148+
dokka {
149149
dokkaSourceSets {
150150
configureEach {
151-
noAndroidSdkLink.set(false)
151+
enableAndroidDocumentationLink.set(true)
152152
}
153153
}
154154
}

multiplatform-markdown-renderer-coil2/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,10 @@ dependencies {
106106
"androidMainApi"(libs.coil2.core)
107107
}
108108

109-
tasks.dokkaHtml.configure {
109+
dokka {
110110
dokkaSourceSets {
111111
configureEach {
112-
noAndroidSdkLink.set(false)
112+
enableAndroidDocumentationLink.set(true)
113113
}
114114
}
115115
}

0 commit comments

Comments
 (0)