Skip to content

Commit 60da52f

Browse files
committed
Use suffix from GitHub URL in link
1 parent 4de9df2 commit 60da52f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,13 +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('/')
143+
val githubUrl = origin.githubUrl(recipeDescriptor.name, recipeSource)
144144
//language=markdown
145145
writeln(
146146
"""
147147
## Recipe source
148148
149-
[GitHub: $recipeSourceFileName](${origin.githubUrl(recipeDescriptor.name, recipeSource)}),
149+
[GitHub: ${githubUrl.substringAfterLast('/')}]($githubUrl),
150150
[Issue Tracker](${origin.issueTrackerUrl()}),
151151
[Maven Central](https://central.sonatype.com/artifact/${origin.groupId}/${origin.artifactId}/)
152152
""".trimIndent()

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class RecipeOrigin(
4242
}
4343

4444
fun githubUrl(recipeName: String, source: URI): String {
45-
//todo we can remove this I think, as third party recipes can now define there very own License
45+
//todo we can remove this I think, as third party recipes can now define their very own License
4646
if (artifactId == "rewrite-third-party") {
4747
return "https://github.com/search?type=code&q=$recipeName"
4848
}

0 commit comments

Comments
 (0)