Skip to content

Commit 4de9df2

Browse files
authored
Add information about the language a recipe is written in (#261)
* Add information about the language a recipe is written in Fixes: #260 * Changes based on Tim's suggestions --------- Co-authored-by: Mike Solomon <mike-solomon@users.noreply.github.com>
1 parent 3008e84 commit 4de9df2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/kotlin/org/openrewrite/RecipeMarkdownWriter.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,12 +140,13 @@ import TabItem from '@theme/TabItem';
140140
} else {
141141
val recipeSource = recipeToSource[recipeDescriptor.name]
142142
requireNotNull(recipeSource) { "Could not find source URI for recipe ${recipeDescriptor.name}" }
143+
val recipeSourceFileName = recipeSource.toString().substringAfterLast('/')
143144
//language=markdown
144145
writeln(
145146
"""
146147
## Recipe source
147148
148-
[GitHub](${origin.githubUrl(recipeDescriptor.name, recipeSource)}),
149+
[GitHub: $recipeSourceFileName](${origin.githubUrl(recipeDescriptor.name, recipeSource)}),
149150
[Issue Tracker](${origin.issueTrackerUrl()}),
150151
[Maven Central](https://central.sonatype.com/artifact/${origin.groupId}/${origin.artifactId}/)
151152
""".trimIndent()

0 commit comments

Comments
 (0)