Skip to content

Commit 3506100

Browse files
committed
Fix multiline descriptions for features in the root module
1 parent 3b2d609 commit 3506100

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/main/kotlin/space/kscience/gradle/KScienceProjectPlugin.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,12 @@ public open class KScienceProjectPlugin : Plugin<Project> {
188188

189189
inputs.property("features", rootReadmeExtension.features)
190190

191+
subprojects.forEach { subproject->
192+
subproject.extensions.findByType<KScienceReadmeExtension>()?.let {
193+
inputs.property("features-${subproject.name}", it.features)
194+
}
195+
}
196+
191197
if (rootReadmeExtension.readmeTemplate.exists()) {
192198
inputs.file(rootReadmeExtension.readmeTemplate)
193199
}

src/main/kotlin/space/kscience/gradle/KScienceReadmeExtension.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public class KScienceReadmeExtension(public val project: Project) {
9797
id: String,
9898
@Language("File") ref: String? = null,
9999
name: String = id,
100-
description: () -> String,
100+
@Language("markdown") description: () -> String,
101101
) {
102102
features += Feature(id, description(), ref, name)
103103
}
@@ -175,7 +175,7 @@ public class KScienceReadmeExtension(public val project: Project) {
175175
*/
176176
internal fun featuresString(itemPrefix: String = " - ", pathPrefix: String = ""): String = buildString {
177177
features.forEach {
178-
appendLine("$itemPrefix[${it.name}]($pathPrefix${it.ref ?: "#"}) : ${it.description}")
178+
appendLine("$itemPrefix[${it.name}]($pathPrefix${it.ref ?: "#"}) : ${it.description.lines().firstOrNull() ?: ""}")
179179
}
180180
}
181181

0 commit comments

Comments
 (0)