Skip to content

Commit

Permalink
Write contributors as a paragraph rather than a list
Browse files Browse the repository at this point in the history
Also place the try Moderne just before rather than after.

Fixes #70
  • Loading branch information
timtebeek committed Nov 20, 2023
1 parent dcf399b commit 4b7a3db
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 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 @@ -1137,20 +1138,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 +1150,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 4b7a3db

Please sign in to comment.