From aaa902d6c27d11bb4ab7031d52a64ccd12dba2d3 Mon Sep 17 00:00:00 2001 From: Tim te Beek Date: Wed, 13 Dec 2023 20:11:37 +0100 Subject: [PATCH] Do not show `` when example is null --- src/main/kotlin/org/openrewrite/RecipeMarkdownGenerator.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/org/openrewrite/RecipeMarkdownGenerator.kt b/src/main/kotlin/org/openrewrite/RecipeMarkdownGenerator.kt index 775b3fe..cad8638 100644 --- a/src/main/kotlin/org/openrewrite/RecipeMarkdownGenerator.kt +++ b/src/main/kotlin/org/openrewrite/RecipeMarkdownGenerator.kt @@ -839,9 +839,10 @@ class RecipeMarkdownGenerator : Runnable { if (option.valid?.isNotEmpty()?: false) { description += " Valid options: " + option.valid?.joinToString { "`$it`" } } + val example = if (option.example != null) "`${option.example}`" else "" writeln( """ - | `${option.type}` | ${option.name} | $description | `${option.example ?: ""}` | + | `${option.type}` | ${option.name} | $description | $example | """.trimIndent() ) }