From 21f4edfd9c6ee26a231285a51480c0316eff1804 Mon Sep 17 00:00:00 2001 From: Guillaume Smet Date: Fri, 9 Aug 2024 14:31:17 +0200 Subject: [PATCH] Config Doc - Use tooltip for default values Fixes #42374 --- .../java/io/quarkus/maven/config/doc/AsciidocFormatter.java | 4 ++++ .../main/resources/templates/tags/configProperty.qute.adoc | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/devtools/config-doc-maven-plugin/src/main/java/io/quarkus/maven/config/doc/AsciidocFormatter.java b/devtools/config-doc-maven-plugin/src/main/java/io/quarkus/maven/config/doc/AsciidocFormatter.java index 29e33c81c49852..7dd76631b4ccab 100644 --- a/devtools/config-doc-maven-plugin/src/main/java/io/quarkus/maven/config/doc/AsciidocFormatter.java +++ b/devtools/config-doc-maven-plugin/src/main/java/io/quarkus/maven/config/doc/AsciidocFormatter.java @@ -78,6 +78,10 @@ String formatTypeDescription(ConfigProperty configProperty) { String formatDefaultValue(ConfigProperty configProperty) { String defaultValue = configProperty.getDefaultValue(); + if (defaultValue == null) { + return null; + } + if (configProperty.isEnum()) { Optional enumConstant = configProperty.getEnumAcceptedValues().values().entrySet().stream() .filter(e -> e.getValue().configValue().equals(defaultValue)) diff --git a/devtools/config-doc-maven-plugin/src/main/resources/templates/tags/configProperty.qute.adoc b/devtools/config-doc-maven-plugin/src/main/resources/templates/tags/configProperty.qute.adoc index 4ca746a55b7406..a96247c5e97285 100644 --- a/devtools/config-doc-maven-plugin/src/main/resources/templates/tags/configProperty.qute.adoc +++ b/devtools/config-doc-maven-plugin/src/main/resources/templates/tags/configProperty.qute.adoc @@ -10,4 +10,4 @@ a|{#if configProperty.phase.fixedAtBuildTime}icon:lock[title=Fixed at build time {#envVar configProperty /} -- {#if configProperty.enum}a{/if}|{configProperty.formatTypeDescription.escapeCellContent.or("")} -|{#if configProperty.defaultValue}`{configProperty.defaultValue.escapeCellContent}`{#else if !configProperty.optional}required icon:exclamation-circle[title=Configuration property is required]{/if} +|{#if configProperty.defaultValue}{configProperty.formatDefaultValue.escapeCellContent}{#else if !configProperty.optional}required icon:exclamation-circle[title=Configuration property is required]{/if}