Skip to content

Commit

Permalink
Merge branch 'main' into include_launchdarkly
Browse files Browse the repository at this point in the history
  • Loading branch information
timtebeek authored Nov 20, 2023
2 parents 02c6ba4 + 03ab9a3 commit 67081d3
Showing 1 changed file with 21 additions and 15 deletions.
36 changes: 21 additions & 15 deletions src/main/kotlin/org/openrewrite/RecipeMarkdownGenerator.kt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import java.nio.file.StandardOpenOption
import java.time.LocalDateTime
import java.time.format.DateTimeFormatter
import java.util.*
import java.util.stream.Collectors
import kotlin.io.path.toPath
import kotlin.system.exitProcess

Expand Down Expand Up @@ -638,7 +639,11 @@ class RecipeMarkdownGenerator : Runnable {
@Suppress("SENSELESS_COMPARISON")
if (descriptor != null && descriptor.description != null) {
appendLine()
appendLine("_${descriptor.description}_")
if (descriptor.description.contains("\n") || descriptor.description.contains("_")){
appendLine(descriptor.description)
} else {
appendLine("_${descriptor.description}_")
}
}
appendLine()

Expand Down Expand Up @@ -1137,20 +1142,6 @@ class RecipeMarkdownGenerator : Runnable {
)
}

// Contributors
if (recipeDescriptor.contributors.isNotEmpty()) {
newLine()
writeln("## Contributors")
for (contributors in recipeDescriptor.contributors) {
if (contributors.email.contains("noreply")) {
writeln("* ${contributors.name}")
} else {
writeln("* [${contributors.name}](mailto:${contributors.email})")
}
}
newLine()
}

newLine()
writeln(
"""
Expand All @@ -1163,6 +1154,21 @@ class RecipeMarkdownGenerator : Runnable {
Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS.
""".trimIndent()
)

// Contributors
if (recipeDescriptor.contributors.isNotEmpty()) {
newLine()
writeln("## Contributors")
writeln(recipeDescriptor.contributors.stream()
.map { contributor: Contributor ->
if (contributor.email.contains("noreply")) {
"* " + contributor.name
} else {
"* [" + contributor.name + "](mailto:" + contributor.email + ")"
}
}.collect(Collectors.joining(", "))
)
}
}
}

Expand Down

0 comments on commit 67081d3

Please sign in to comment.