From 5b63b807adf95c05fa4c60ebf2354a26028d2f8b Mon Sep 17 00:00:00 2001 From: dreis2211 Date: Sun, 7 Apr 2019 20:43:09 +0200 Subject: [PATCH 1/2] Separate compound properties in appendices --- .../CompoundConfigurationTableEntry.java | 9 ++++----- .../CompoundConfigurationTableEntryTests.java | 7 ++++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/main/java/org/springframework/boot/configurationdocs/CompoundConfigurationTableEntry.java b/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/main/java/org/springframework/boot/configurationdocs/CompoundConfigurationTableEntry.java index 1c58f2cc66..437a4922cd 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/main/java/org/springframework/boot/configurationdocs/CompoundConfigurationTableEntry.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/main/java/org/springframework/boot/configurationdocs/CompoundConfigurationTableEntry.java @@ -46,11 +46,10 @@ class CompoundConfigurationTableEntry extends ConfigurationTableEntry { @Override public void write(AsciidocBuilder builder) { - builder.append("|`+++"); - this.configurationKeys.forEach(builder::appendln); - builder.appendln("+++`"); - builder.appendln("|"); - builder.appendln("|+++", this.description, "+++"); + builder.append("|"); + this.configurationKeys.forEach((key) -> builder.appendln("`+", key, "+` +")); + builder.appendln("").appendln("|").append("|+++") + .append(this.description).appendln("+++"); } } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/test/java/org/springframework/boot/configurationdocs/CompoundConfigurationTableEntryTests.java b/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/test/java/org/springframework/boot/configurationdocs/CompoundConfigurationTableEntryTests.java index 65a663630c..ac50091b53 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/test/java/org/springframework/boot/configurationdocs/CompoundConfigurationTableEntryTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/test/java/org/springframework/boot/configurationdocs/CompoundConfigurationTableEntryTests.java @@ -47,9 +47,10 @@ public class CompoundConfigurationTableEntryTests { entry.addConfigurationKeys(firstProp, secondProp, thirdProp); AsciidocBuilder builder = new AsciidocBuilder(); entry.write(builder); - assertThat(builder.toString()).isEqualTo("|`+++spring.test.first" + NEWLINE - + "spring.test.second" + NEWLINE + "spring.test.third" + NEWLINE + "+++`" - + NEWLINE + "|" + NEWLINE + "|+++This is a description.+++" + NEWLINE); + assertThat(builder.toString()).isEqualTo( + "|`+spring.test.first+` +" + NEWLINE + "`+spring.test.second+` +" + + NEWLINE + "`+spring.test.third+` +" + NEWLINE + NEWLINE + "|" + + NEWLINE + "|+++This is a description.+++" + NEWLINE); } } From c4938055b45bf4b21e201a9c96a6fb954e0ee230 Mon Sep 17 00:00:00 2001 From: Brian Clozel Date: Tue, 30 Apr 2019 15:32:26 +0200 Subject: [PATCH 2/2] Polish "Separate compound properties in appendices" Closes gh-16480 --- spring-boot-project/spring-boot-parent/pom.xml | 2 +- .../boot/configurationdocs/AsciidocBuilder.java | 12 ++++++++++++ .../CompoundConfigurationTableEntry.java | 6 +++--- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/spring-boot-project/spring-boot-parent/pom.xml b/spring-boot-project/spring-boot-parent/pom.xml index beb06e0884..74a4f39921 100644 --- a/spring-boot-project/spring-boot-parent/pom.xml +++ b/spring-boot-project/spring-boot-parent/pom.xml @@ -29,7 +29,7 @@ 1.10.6 6.14.3 1.0.6.RELEASE - 0.1.0.RELEASE + 0.1.1.RELEASE https://github.com/spring-projects/spring-boot diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/main/java/org/springframework/boot/configurationdocs/AsciidocBuilder.java b/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/main/java/org/springframework/boot/configurationdocs/AsciidocBuilder.java index 104fec4d86..5a51d84a69 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/main/java/org/springframework/boot/configurationdocs/AsciidocBuilder.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/main/java/org/springframework/boot/configurationdocs/AsciidocBuilder.java @@ -31,6 +31,18 @@ class AsciidocBuilder { this.content = new StringBuilder(); } + public AsciidocBuilder appendKey(Object... items) { + for (Object item : items) { + append("`+", item, "+` +", NEWLINE); + } + return this; + } + + public AsciidocBuilder newLine() { + append(NEWLINE); + return this; + } + public AsciidocBuilder appendln(Object... items) { append(items); append(NEWLINE); diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/main/java/org/springframework/boot/configurationdocs/CompoundConfigurationTableEntry.java b/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/main/java/org/springframework/boot/configurationdocs/CompoundConfigurationTableEntry.java index 437a4922cd..1711e52aa0 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/main/java/org/springframework/boot/configurationdocs/CompoundConfigurationTableEntry.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/main/java/org/springframework/boot/configurationdocs/CompoundConfigurationTableEntry.java @@ -47,9 +47,9 @@ class CompoundConfigurationTableEntry extends ConfigurationTableEntry { @Override public void write(AsciidocBuilder builder) { builder.append("|"); - this.configurationKeys.forEach((key) -> builder.appendln("`+", key, "+` +")); - builder.appendln("").appendln("|").append("|+++") - .append(this.description).appendln("+++"); + this.configurationKeys.forEach(builder::appendKey); + builder.newLine().appendln("|"); + builder.appendln("|+++", this.description, "+++"); } }