@@ -281,6 +281,40 @@ private int getMaxLength(Stream<String> stringStream) {
281281 return stringStream .map (String ::trim ).mapToInt (String ::length ).max ().orElse (0 );
282282 }
283283
284+ /**
285+ * To reduce variance, use the same description width as the current document.
286+ */
287+ private int getDescriptionColumnWidth (String outputFile , Stream <String > stringStream ) {
288+ Map <String , Integer > DES_WIDTH = new HashMap <>();
289+ DES_WIDTH .put ("configuration-properties-azure-active-directory.md" , 641 );
290+ DES_WIDTH .put ("configuration-properties-azure-active-directory-b2c.md" , 470 );
291+ DES_WIDTH .put ("configuration-properties-azure-service-bus.md" , 194 );
292+ DES_WIDTH .put ("configuration-properties-azure-service-bus-jms.md" , 446 );
293+ return DES_WIDTH .getOrDefault (outputFile .substring (outputFile .lastIndexOf ("/" ) + 1 ),
294+ getMaxLength (stringStream ));
295+ }
296+
297+ private String getServiceName (String outputFile ) {
298+ HashMap <String , String > DES_WIDTH = new HashMap <>();
299+ DES_WIDTH .put ("configuration-properties-all.md" , "Spring Cloud Azure" );
300+ DES_WIDTH .put ("configuration-properties-azure-active-directory.md" , "Microsoft Entra" );
301+ DES_WIDTH .put ("configuration-properties-azure-active-directory-b2c.md" , "Azure Active Directory B2C" );
302+ DES_WIDTH .put ("configuration-properties-azure-app-configuration.md" , "Azure App Configuration" );
303+ DES_WIDTH .put ("configuration-properties-azure-cosmos-db.md" , "Azure Cosmos DB" );
304+ DES_WIDTH .put ("configuration-properties-azure-event-hubs.md" , "Azure Event Hubs" );
305+ DES_WIDTH .put ("configuration-properties-azure-key-vault.md" , "Azure Key Vault" );
306+ DES_WIDTH .put ("configuration-properties-azure-key-vault-certificates.md" , "Azure Key Vault Certificates" );
307+ DES_WIDTH .put ("configuration-properties-azure-key-vault-secrets.md" , "Azure Key Vault Secrets" );
308+ DES_WIDTH .put ("configuration-properties-azure-service-bus.md" , "Azure Service Bus" );
309+ DES_WIDTH .put ("configuration-properties-azure-service-bus-jms.md" , "Azure Service Bus JMS" );
310+ DES_WIDTH .put ("configuration-properties-azure-storage.md" , "Azure Storage" );
311+ DES_WIDTH .put ("configuration-properties-azure-storage-blob.md" , "Azure Storage Blob" );
312+ DES_WIDTH .put ("configuration-properties-azure-storage-file-share.md" , "Azure Storage File Share" );
313+ DES_WIDTH .put ("configuration-properties-azure-storage-queue.md" , "Azure Storage Queue" );
314+ DES_WIDTH .put ("configuration-properties-global.md" , "Spring Cloud Azure Global" );
315+ return DES_WIDTH .getOrDefault (outputFile .substring (outputFile .lastIndexOf ("/" ) + 1 ), null );
316+ }
317+
284318 /**
285319 * Generate properties markdown files.
286320 * @param outputFile the output file
@@ -289,21 +323,31 @@ private int getMaxLength(Stream<String> stringStream) {
289323 */
290324 private void generatePropertiesFile (String outputFile , TreeMap <String , String > descriptions , String date ) {
291325 int nameColumnWidth = getMaxLength (descriptions .keySet ().stream ());
292- int descriptionColumnWidth = getMaxLength ( descriptions .values ().stream ());
326+ int descriptionColumnWidth = getDescriptionColumnWidth ( outputFile , descriptions .values ().stream ());
293327 Path path = Paths .get (outputFile );
328+ String serviceName = getServiceName (outputFile );
294329 try (BufferedWriter writer = Files .newBufferedWriter (path , StandardCharsets .UTF_8 )) {
295330 writer .write ("---" );
296331 writer .newLine ();
332+ writer .write (String .format ("title: %s configuration properties" , serviceName ));
333+ writer .newLine ();
334+ writer .write (String .format ("description: This reference doc contains all %s configuration properties." ,
335+ serviceName ));
336+ writer .newLine ();
297337 writer .write ("author: KarlErickson" );
298338 writer .newLine ();
299- writer .write ("ms.author: v-yonghuiye " );
339+ writer .write ("ms.author: hangwan " );
300340 writer .newLine ();
301341 writer .write ("ms.date: " + date );
302342 writer .newLine ();
343+ writer .write ("ms.topic: reference" );
344+ writer .newLine ();
345+ writer .write ("ms.custom: devx-track-java, spring-cloud-azure, devx-track-extended-java" );
346+ writer .newLine ();
303347 writer .write ("---" );
304348 writer .newLine ();
305349 writer .newLine ();
306- writer .write ("## " + generateTitleName ( outputFile ) + " properties" );
350+ writer .write (String . format ( "# %s configuration properties", serviceName ) );
307351 writer .newLine ();
308352 writer .newLine ();
309353 writer .write ("> [!div class=\" mx-tdBreakAll\" ]" );
0 commit comments